本文整理汇总了Python中gui.GUI_SETTINGS.lookup方法的典型用法代码示例。如果您正苦于以下问题:Python GUI_SETTINGS.lookup方法的具体用法?Python GUI_SETTINGS.lookup怎么用?Python GUI_SETTINGS.lookup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gui.GUI_SETTINGS
的用法示例。
在下文中一共展示了GUI_SETTINGS.lookup方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getURL
# 需要导入模块: from gui import GUI_SETTINGS [as 别名]
# 或者: from gui.GUI_SETTINGS import lookup [as 别名]
def getURL(self, name, callback):
urlSettings = GUI_SETTINGS.lookup(name)
if urlSettings:
url = yield self.__urlMarcos.parse(str(urlSettings))
else:
url = yield lambda callback: callback('')
callback(url)
示例2: quality
# 需要导入模块: from gui import GUI_SETTINGS [as 别名]
# 或者: from gui.GUI_SETTINGS import lookup [as 别名]
def quality(self):
boosterQualityValues = GUI_SETTINGS.lookup(self.boosterGuiType) or _BOOSTER_QUALITY_VALUES
if self.effectValue >= boosterQualityValues[BOOSTER_QUALITY_NAMES.BIG]:
return BOOSTER_QUALITY_NAMES.BIG
elif self.effectValue >= boosterQualityValues[BOOSTER_QUALITY_NAMES.MEDIUM]:
return BOOSTER_QUALITY_NAMES.MEDIUM
else:
return BOOSTER_QUALITY_NAMES.SMALL
示例3: _getClubEmblemUrl
# 需要导入模块: from gui import GUI_SETTINGS [as 别名]
# 或者: from gui.GUI_SETTINGS import lookup [as 别名]
def _getClubEmblemUrl(emblemID, size):
try:
urlPattern = GUI_SETTINGS.lookup('clubEmblems')
if urlPattern and emblemID:
return urlPattern % {'emblemID': emblemID,
'size': size}
except:
LOG_CURRENT_EXCEPTION()
示例4: canChangeWebSettings
# 需要导入模块: from gui import GUI_SETTINGS [as 别名]
# 或者: from gui.GUI_SETTINGS import lookup [as 别名]
def canChangeWebSettings(self, profile, club = None):
url = GUI_SETTINGS.lookup('clubSettings')
if not url:
return error(_CCR.DEFAULT)
else:
if club is not None:
permissions = club.getPermissions()
if not permissions.canChangeWebSettings():
return error(_CCR.DEFAULT)
if club.getTotalDossier().getTotalStats().getBattlesCount() < CLUB_LIMITS.MIN_BATTLES_COUNT_TO_CHANGE_NAME:
return error(_CCR.NOT_ENOUGH_RATED_BATTLES)
return success()
示例5: canChangeWebSettings
# 需要导入模块: from gui import GUI_SETTINGS [as 别名]
# 或者: from gui.GUI_SETTINGS import lookup [as 别名]
def canChangeWebSettings(self, profile, club = None):
url = GUI_SETTINGS.lookup('clubSettings')
if not url:
return error(_CCR.DEFAULT)
if club is not None:
for rID in {_CRT.CHANGE_CLUB_NAME, _CRT.CHANGE_CLUB_EMBLEM}:
result = self._isClubRequestValid(rID, club, 'canChangeWebSettings')
if result.success:
return result
return error(_CCR.NOT_ENOUGH_RATED_BATTLES)
return success()
示例6: __init__
# 需要导入模块: from gui import GUI_SETTINGS [as 别名]
# 或者: from gui.GUI_SETTINGS import lookup [as 别名]
def __init__(self, proxy):
super(EncyclopediaController, self).__init__(proxy)
self.__activated = False
self.__recommendations = []
self.__eventManager = Event.EventManager()
self.__urlMacros = URLMarcos()
self.__isLobbyStarted = False
self.__hasNewRecommendations = False
if GUI_SETTINGS.lookup('encyclopedia'):
self.__baseUrl = GUI_SETTINGS.encyclopedia['url']
self.__isSuitableLanguage = GUI_SETTINGS.encyclopedia['enabled']
else:
self.__baseUrl = None
self.__isSuitableLanguage = False
self.onNewRecommendationReceived = Event.Event(self.__eventManager)
self.onStateChanged = Event.Event(self.__eventManager)
self.__isStateSynced = False
return
示例7: onConnected
# 需要导入模块: from gui import GUI_SETTINGS [as 别名]
# 或者: from gui.GUI_SETTINGS import lookup [as 别名]
def onConnected(self):
if GUI_SETTINGS.lookup('encyclopedia'):
self.__baseUrl = GUI_SETTINGS.encyclopedia['url']
self.__isSuitableLanguage = GUI_SETTINGS.encyclopedia['enabled']