本文整理汇总了Python中shared_utils.forEach函数的典型用法代码示例。如果您正苦于以下问题:Python forEach函数的具体用法?Python forEach怎么用?Python forEach使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了forEach函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __fillShells
def __fillShells(self, ctrl):
forEach(lambda args: self.__onShellsAdded(*args), ctrl.getOrderedShellsLayout())
shellCD = ctrl.getNextShellCD()
if shellCD is not None:
self.__onNextShellChanged(shellCD)
shellCD = ctrl.getCurrentShellCD()
if shellCD is not None:
self.__onCurrentShellChanged(shellCD)
return
示例2: __doChangeSetting
def __doChangeSetting(self, item, entityName = None, avatar = None):
result, error = item.canActivate(entityName, avatar)
if result and avatar_getter.isPlayerOnArena(avatar):
if item.getStage() == EQUIPMENT_STAGES.PREPARING:
item.deactivate()
else:
forEach(lambda e: e.deactivate(), [ e for e in self._equipments.itervalues() if e.getStage() == EQUIPMENT_STAGES.PREPARING ])
item.activate(entityName, avatar)
return (result, error)
示例3: _onClubUpdated
def _onClubUpdated(self, clubDbID, clubCompactDescr):
if clubDbID == self.__clubDbID:
if not clubCompactDescr:
self.notify('onClubUpdated', None)
if self.__clubsCtrl is not None:
self.__clubsCtrl._removeSubscription(clubDbID)
return
oldClub, newClub = self.__club, Club(clubDbID, clubCompactDescr)
self.__club = newClub
if oldClub is None:
self.notify('onClubUpdated', newClub)
elif oldClub.isChanged(newClub):
forEach(lambda c: c(self, oldClub, newClub), self.__comparators)
示例4: _invoke
def _invoke(self, method, *args):
forEach(operator.methodcaller(method, *args), self.__plugins.itervalues())
示例5: clearNotification
def clearNotification(self):
self.stopNotification()
forEach(operator.methodcaller('clear'), self.__notificators)
self.__notificators = []
示例6: stopNotification
def stopNotification(self):
forEach(operator.methodcaller('stopNotification'), self.__notificators)
示例7: startNotification
def startNotification(self):
forEach(operator.methodcaller("startNotification"), self.__notificators)
示例8: _invoke
def _invoke(self, method, *args):
forEach(operator.methodcaller(method, *args), self._controllers.itervalues())
示例9: sendEvent
def sendEvent(eventName, *args, **kwargs):
forEach(lambda mod: _callModMethod(mod, eventName, *args, **kwargs), _mods.itervalues())
示例10: fini
def fini():
forEach(lambda mod: _callModMethod(mod, 'fini'), _mods.itervalues())
_mods.clear()
示例11: init
def init():
global _mods
_mods = _findValidMODs()
forEach(lambda mod: _callModMethod(mod, 'init'), _mods.itervalues())
示例12: __fillOptionalDevices
def __fillOptionalDevices(self, ctrl):
forEach(lambda args: self.__onOptionalDeviceAdded(*args), ctrl.getOrderedOptionalDevicesLayout())
示例13: __fillEquipments
def __fillEquipments(self, ctrl):
forEach(lambda args: self.__onEquipmentAdded(*args), ctrl.getOrderedEquipmentsLayout())