本文整理匯總了Python中openlp.core.lib.Settings.replace方法的典型用法代碼示例。如果您正苦於以下問題:Python Settings.replace方法的具體用法?Python Settings.replace怎麽用?Python Settings.replace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類openlp.core.lib.Settings
的用法示例。
在下文中一共展示了Settings.replace方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_media_players
# 需要導入模塊: from openlp.core.lib import Settings [as 別名]
# 或者: from openlp.core.lib.Settings import replace [as 別名]
def get_media_players():
"""
This method extracts the configured media players and overridden player
from the settings.
"""
log.debug('get_media_players')
saved_players = Settings().value('media/players')
reg_ex = QtCore.QRegExp(".*\[(.*)\].*")
if Settings().value('media/override player') == QtCore.Qt.Checked:
if reg_ex.exactMatch(saved_players):
overridden_player = '%s' % reg_ex.cap(1)
else:
overridden_player = 'auto'
else:
overridden_player = ''
saved_players_list = saved_players.replace('[', '').replace(']', '').split(',')
return saved_players_list, overridden_player