本文整理匯總了Python中tutorial.control.context.GlobalStorage.value方法的典型用法代碼示例。如果您正苦於以下問題:Python GlobalStorage.value方法的具體用法?Python GlobalStorage.value怎麽用?Python GlobalStorage.value使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類tutorial.control.context.GlobalStorage
的用法示例。
在下文中一共展示了GlobalStorage.value方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: RunCtx
# 需要導入模塊: from tutorial.control.context import GlobalStorage [as 別名]
# 或者: from tutorial.control.context.GlobalStorage import value [as 別名]
class RunCtx(object):
__slots__ = ['cache',
'isFirstStart',
'databaseID',
'afterBattle',
'restart',
'isInRandomQueue',
'isInPrebattle',
'isInTutorialQueue',
'settings',
'bonusCompleted',
'isInHistoricalQueue',
'isInEventBattlesQueue']
def __init__(self, **kwargs):
super(RunCtx, self).__init__()
self.cache = None
self.isFirstStart = False
self.databaseID = kwargs.get('databaseID', 0L)
self.restart = kwargs.get('restart', False)
self.isInRandomQueue = kwargs.get('isInRandomQueue', False)
self.isInPrebattle = isInPrebattle()
self.isInTutorialQueue = GlobalStorage(GLOBAL_FLAG.IN_QUEUE, kwargs.get('isInTutorialQueue', False))
self.isInHistoricalQueue = kwargs.get('isInHistoricalQueue', False)
self.isInEventBattlesQueue = kwargs.get('isInEventBattles', False)
self.settings = kwargs.get('settings', TUTORIAL_SETTINGS.DEFAULT_SETTINGS)
self.bonusCompleted = kwargs.get('bonusCompleted', 0)
return
def __repr__(self):
return 'RunCtx(settings = {0:>s}, bonuses = {1:n}, cache = {2!r:s}, inPrb = {3!r:s}, inQueue = {4!r:s})'.format(self.settings, self.bonusCompleted, self.cache, self.isInPrebattle, self.isInTutorialQueue.value())