forked from openlp/openlp
change camelcase variables
This commit is contained in:
parent
360df826e1
commit
527f4cc00c
@ -71,9 +71,9 @@ def get_media_players():
|
|||||||
This method extract the configured media players and overridden player from
|
This method extract the configured media players and overridden player from
|
||||||
the settings
|
the settings
|
||||||
|
|
||||||
``playersList``
|
``players_list``
|
||||||
this is a python list with all active media players
|
this is a python list with all active media players
|
||||||
``overriddenPlayer``
|
``overridden_player``
|
||||||
here an special media player is choosen for all media actions
|
here an special media player is choosen for all media actions
|
||||||
"""
|
"""
|
||||||
log.debug(u'get_media_players')
|
log.debug(u'get_media_players')
|
||||||
@ -82,35 +82,35 @@ def get_media_players():
|
|||||||
if len(players) == 0:
|
if len(players) == 0:
|
||||||
players = u'webkit'
|
players = u'webkit'
|
||||||
reg_ex = QtCore.QRegExp(".*\[(.*)\].*")
|
reg_ex = QtCore.QRegExp(".*\[(.*)\].*")
|
||||||
canOverride = True if QtCore.QSettings().value(u'media/override player',
|
can_override = True if QtCore.QSettings().value(u'media/override player',
|
||||||
QtCore.QVariant(QtCore.Qt.Unchecked)) == QtCore.Qt.Checked else False
|
QtCore.QVariant(QtCore.Qt.Unchecked)) == QtCore.Qt.Checked else False
|
||||||
if canOverride:
|
if can_override:
|
||||||
if reg_ex.exactMatch(players):
|
if reg_ex.exactMatch(players):
|
||||||
overriddenPlayer = u'%s' % reg_ex.cap(1)
|
overridden_player = u'%s' % reg_ex.cap(1)
|
||||||
else:
|
else:
|
||||||
overriddenPlayer = u'auto'
|
overridden_player = u'auto'
|
||||||
else:
|
else:
|
||||||
overriddenPlayer = u''
|
overridden_player = u''
|
||||||
playersList = players.replace('[', '').replace(']', '').split(u',')
|
players_list = players.replace('[', '').replace(']', '').split(u',')
|
||||||
return [playersList, overriddenPlayer]
|
return players_list, overridden_player
|
||||||
|
|
||||||
|
|
||||||
def set_media_players(playersList, overriddenPlayer=u'auto'):
|
def set_media_players(players_list, overridden_player=u'auto'):
|
||||||
"""
|
"""
|
||||||
This method saves the configured media players and overridden player to the
|
This method saves the configured media players and overridden player to the
|
||||||
settings
|
settings
|
||||||
|
|
||||||
``playersList``
|
``players_list``
|
||||||
this is a python list with all active media players
|
this is a python list with all active media players
|
||||||
``overriddenPlayer``
|
``overridden_player``
|
||||||
here an special media player is choosen for all media actions
|
here an special media player is choosen for all media actions
|
||||||
"""
|
"""
|
||||||
log.debug(u'set_media_players')
|
log.debug(u'set_media_players')
|
||||||
players = u','.join(playersList)
|
players = u','.join(players_list)
|
||||||
canOverride = True if QtCore.QSettings().value(u'media/override player',
|
can_override = True if QtCore.QSettings().value(u'media/override player',
|
||||||
QtCore.QVariant(QtCore.Qt.Unchecked)) == QtCore.Qt.Checked else False
|
QtCore.QVariant(QtCore.Qt.Unchecked)) == QtCore.Qt.Checked else False
|
||||||
if canOverride and overriddenPlayer != u'auto':
|
if can_override and overridden_player != u'auto':
|
||||||
players = players.replace(overriddenPlayer, u'[%s]' % overriddenPlayer)
|
players = players.replace(overridden_player, u'[%s]' % overridden_player)
|
||||||
QtCore.QSettings().setValue(u'media/players', QtCore.QVariant(players))
|
QtCore.QSettings().setValue(u'media/players', QtCore.QVariant(players))
|
||||||
|
|
||||||
from mediacontroller import MediaController
|
from mediacontroller import MediaController
|
||||||
|
Loading…
Reference in New Issue
Block a user