本文整理汇总了Python中shared_utils.makeTupleByDict函数的典型用法代码示例。如果您正苦于以下问题:Python makeTupleByDict函数的具体用法?Python makeTupleByDict怎么用?Python makeTupleByDict使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了makeTupleByDict函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, serverSettings):
self.onServerSettingsChange = Event()
self.__serverSettings = serverSettings if serverSettings else {}
if 'roaming' in self.__serverSettings:
roamingSettings = self.__serverSettings['roaming']
self.__roamingSettings = RoamingSettings(roamingSettings[0], roamingSettings[1], [ _ServerInfo(*s) for s in roamingSettings[2] ])
else:
self.__roamingSettings = RoamingSettings.defaults()
if 'file_server' in self.__serverSettings:
self.__fileServerSettings = _FileServerSettings(self.__serverSettings['file_server'])
else:
self.__fileServerSettings = _FileServerSettings.defaults()
if 'regional_settings' in self.__serverSettings:
self.__regionalSettings = makeTupleByDict(_RegionalSettings, self.__serverSettings['regional_settings'])
else:
self.__regionalSettings = _RegionalSettings.defaults()
try:
self.__eSportCurrentSeason = makeTupleByDict(_ESportCurrentSeason, self.__serverSettings)
except TypeError:
self.__eSportCurrentSeason = _ESportCurrentSeason.defaults()
if 'clanProfile' in self.__serverSettings:
self.__updateClanProfile(self.__serverSettings)
else:
self.__clanProfile = _ClanProfile.defaults()
示例2: __init__
def __init__(self, results, dp):
super(ClubResults, self).__init__(results, dp)
personal = results['personal'].values()[0]
self._ownClub = makeTupleByDict(_ClubInfo, personal['club'])
self._enemyClub = makeTupleByDict(_ClubInfo, personal['enemyClub'])
self.__teamInfoCBs = {}
for clubDbID in (self._ownClub.clubDBID, self._enemyClub.clubDBID):
self.startClubListening(clubDbID)
示例3: updateState
def updateState(self):
params = {}
if self.__gasAttackMgr.state == GasAttackState.PREPARE:
params['state'] = GAS_ATTACK_STATE.PREPEARING
params['prevState'] = self.__state.state
params['center'] = self.__gasAttackMgr.settings.position
params['timeLeft'] = self.__getTimeLeft()
elif self.__gasAttackMgr.state in (GasAttackState.ATTACK, GasAttackState.DONE):
centerDistance = self.__getCenterDistance()
currentRadius = self.__getCurrentRadius()
cloudDistance = self.__getCloudDistance(currentRadius)
safeZoneDistance = self.__getSafeZoneDistance()
if not BigWorld.player().isVehicleAlive:
state = GAS_ATTACK_STATE.DEAD
elif safeZoneDistance == 0:
state = GAS_ATTACK_STATE.INSIDE_SAFE_ZONE
elif cloudDistance == 0:
state = GAS_ATTACK_STATE.INSIDE_CLOUD
elif cloudDistance <= _WARNING_DISTANCE:
state = GAS_ATTACK_STATE.NEAR_CLOUD
else:
state = GAS_ATTACK_STATE.NEAR_SAFE
params['state'] = state
params['prevState'] = self.__state.state
params['center'] = self.__gasAttackMgr.settings.position
params['timeLeft'] = self.__getTimeLeft()
params['currentRadius'] = currentRadius
params['safeZoneRadius'] = self.__gasAttackMgr.settings.endRadius
params['centerDistance'] = centerDistance
params['safeZoneDistance'] = safeZoneDistance
params['gasCloudDistance'] = cloudDistance
self.__state = makeTupleByDict(_GasAttackState, params)
示例4: getDataObj
def getDataObj(self, incomeData):
incomeData = incomeData or []
result = {}
for data in incomeData:
result[data['account_id']] = makeTupleByDict(items.AccountClanRatingsData, data)
return result
示例5: getExtra
def getExtra(self):
if self._extras is None:
return
elif self._prebattleTypeID in _EXTRA_BY_PRB_TYPE:
return makeTupleByDict(_EXTRA_BY_PRB_TYPE[self._prebattleTypeID], self._extras)
else:
return
示例6: getBuildings
def getBuildings(self):
result = []
for b in self.buildings:
try:
result.append(makeTupleByDict(self._Building, b))
except:
LOG_WARNING('There is error while collecting Buildings list', self.buildings)
return result
示例7: getTankmenData
def getTankmenData(self):
result = []
if self._value is not None:
for tankmanData in self._value:
if type(tankmanData) is str:
result.append(self._makeTmanInfoByDescr(tankmen.TankmanDescr(compactDescr=tankmanData)))
else:
result.append(makeTupleByDict(self._TankmanInfoRecord, tankmanData))
return result
示例8: __init__
def __init__(self, serverSettings):
self.__serverSettings = serverSettings if serverSettings else {}
if "roaming" in self.__serverSettings:
roamingSettings = self.__serverSettings["roaming"]
self.__roamingSettings = RoamingSettings(
roamingSettings[0], roamingSettings[1], [_ServerInfo(*s) for s in roamingSettings[2]]
)
else:
self.__roamingSettings = RoamingSettings.defaults()
if "file_server" in self.__serverSettings:
self.__fileServerSettings = _FileServerSettings(self.__serverSettings["file_server"])
else:
self.__fileServerSettings = _FileServerSettings.defaults()
if "regional_settings" in self.__serverSettings:
self.__regionalSettings = makeTupleByDict(_RegionalSettings, self.__serverSettings["regional_settings"])
else:
self.__regionalSettings = _RegionalSettings.defaults()
try:
self.__eSportCurrentSeason = makeTupleByDict(_ESportCurrentSeason, self.__serverSettings)
except TypeError:
self.__eSportCurrentSeason = _ESportCurrentSeason.defaults()
示例9: getFalloutConfig
def getFalloutConfig(self, queueType):
arenaBonusType = QUEUE_TYPE_TO_ARENA_BONUS_TYPE.get(queueType, ARENA_BONUS_TYPE.UNKNOWN)
return makeTupleByDict(FalloutConfig, self.__getFallout().get(arenaBonusType, {}))
示例10: getFalloutConfig
def getFalloutConfig(self, battleType):
return makeTupleByDict(FalloutConfig, self.__getFallout().get(battleType, {}))
示例11: __init__
def __init__(self, results, dp):
self._dp = weakref.proxy(dp)
self._common = makeTupleByDict(stats.CommonInfo, results['common'])
self._personal = makeTupleByDict(stats.PersonalInfo, results['personal'].values()[0])