当前位置: 首页>>代码示例>>Python>>正文


Python uthread.pool函数代码示例

本文整理汇总了Python中uthread.pool函数的典型用法代码示例。如果您正苦于以下问题:Python pool函数的具体用法?Python pool怎么用?Python pool使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了pool函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: GetImage

    def GetImage(self, itemID, size, handler, sprite = None, orderIfMissing = True, callback = None, defaultIcon = 'res:/UI/Texture/notavailable.dds', isAlliance = False):
        if uicore.desktop.dpiScaling > 1.0 and not isAlliance:
            size = size * 2
        if not isinstance(itemID, numbers.Integral):
            return defaultIcon
        if util.IsDustCharacter(itemID):
            try:
                character = cfg.eveowners.Get(itemID)
                path = const.dustCharacterPortraits[int(character.gender)][evetypes.GetRaceID(character.typeID)]
                isFresh = True
            except KeyError:
                return defaultIcon

        else:
            path, isFresh = handler.GetCachedImage(itemID, size)
        if sprite is not None:
            sprite.LoadTexture(path or defaultIcon)
        if not isFresh and orderIfMissing and not handler.MissingFromServer(itemID):
            if (itemID, size, handler) in self.currentlyFetching:
                self.currentlyFetching[itemID, size, handler].append([sprite, callback])
            else:
                self.imageServerQueue[itemID, size, handler].append([sprite, callback])
            if len(self.imageServerQueue) > self.fetchingFromImageServer and self.fetchingFromImageServer < MAX_PORTRAIT_THREADS:
                self.fetchingFromImageServer += 1
                uthread.pool('photo::FetchRemoteImages', self.__FetchFromImageServer)
        elif handler.MissingFromServer(itemID) and path is None:
            return defaultIcon
        if isFresh:
            return path
开发者ID:connoryang,项目名称:dec-eve-serenity,代码行数:29,代码来源:evePhotosvc.py

示例2: OnComboChange

 def OnComboChange(self, entry, header, value, *args):
     if self.sr.Get('data'):
         if entry.name == 'eventType':
             self.sr.data[4] = value
             self.sr.data[0] = None
         self.page = 0
         uthread.pool('standing::OnComboChange', self.Load, self.sr.data[1], self.sr.data[2])
开发者ID:Pluckyduck,项目名称:eve,代码行数:7,代码来源:standingsvc.py

示例3: updateWeapons

 def updateWeapons(self):
     if self.disabled:
         self.__updateTimer = None
         return
     
     weaponModules = findModules(groupNames=WeaponGroupNames)
     
     for moduleID, module in weaponModules.items():
         if hasattr(module, "ChangeAmmo"):
             self.ensureModuleHooked(module)
                     
         canActivate = canActivateModule(module)[0]
         canDeactivate = canDeactivateModule(module)[0]
         
         currentTarget = self.__activeModules.get(moduleID, None)
         if currentTarget:
             isActive = isModuleActive(module)
             if isActive == False:
                 del self.__activeModules[moduleID]
                 currentTarget = None                    
         
         if (
             ((currentTarget is not None) and canDeactivate) or
             canActivate
         ):
             uthread.pool("DoUpdateModule", self.doUpdateModule, moduleID, module, currentTarget)
开发者ID:Sancus,项目名称:shootbluesscripts,代码行数:26,代码来源:weaponhelper.py

示例4: JoinEchoChannel

    def JoinEchoChannel(self):
        self.LogInfo('JoinEchoChannel')
        if self.LoggedIn():
            if len(self.members.keys()) == 0:
                if self.connector.ChannelJoinInProgressCount() == 0 and self.echo == False:
                    self.echo = True
                    uthread.pool('vivox::JoinChannel', self._JoinEchoChannel)
                    return
        elif self.vivoxLoginState != vivoxConstants.VXCLOGINSTATE_LOGGINGIN:
            self.autoJoinQueue = ['Echo']
            self.LogInfo('Not logged in calling login')
            self.Login()
            return
        if 'Echo' in self.members:
            self.LeaveEchoChannel()
            return
        if self.AppCanJoinEchoChannel():
            for channel in self.members.keys():
                self._LeaveChannel(channel)

            if 'Echo' not in self.autoJoinQueue:
                self.autoJoinQueue = ['Echo']
            else:
                self.LogError('Wait a second, I already have the echo channel in my autoJoinQueue!')
        else:
            sm.ScatterEvent('OnEchoChannel', False)
开发者ID:Pluckyduck,项目名称:eve,代码行数:26,代码来源:vivoxService.py

示例5: Init

 def Init(self):
     if getattr(self, 'vivoxStatus', vivoxConstants.VIVOX_NONE) != vivoxConstants.VIVOX_NONE:
         self.LogInfo('Init vivoxStatus was: ', self.vivoxStatus)
         return
     if boot.region == 'optic':
         self.LogInfo('Vivox is not supported in optic')
         self.vivoxStatus = vivoxConstants.VIVOX_OPTIC
         return
     if not self.Enabled():
         self.LogInfo('Vivox has been disabled in settings')
         return
     if not self.subscriber:
         self.LogWarn('This character is not voice enabled on the server, this might be related to a server-side error.')
         return
     userid = session.userid
     self.charid = session.charid
     self.vivoxStatus = vivoxConstants.VIVOX_INITIALIZING
     self.password = self.voiceMgr.GetPassword()
     self.vivoxServer = self.voiceMgr.GetServer()
     self.LogNotice('Using VivoxServer', self.vivoxServer)
     hashValue = hashlib.md5(str(userid) + str(self.charid))
     self.vivoxUserName = str(self.charid) + 'U' + hashValue.hexdigest()
     self.LogInfo('Init vivoxStatus was: ', self.vivoxStatus)
     self.connector = vivox.Connector()
     self.connector.callback = self
     self.LogInfo('vivoxService: Initializing application specific settings')
     uthread.pool('vivox::Init', self._Init)
开发者ID:Pluckyduck,项目名称:eve,代码行数:27,代码来源:vivoxService.py

示例6: GetAvailableVoiceFonts

 def GetAvailableVoiceFonts(self):
     if self.LoggedIn():
         if self.voiceFontList is None:
             self.LogInfo('Requesting Voice Fonts from server')
             uthread.pool('vivox::GetAvailableVoiceFontseve', self._GetAvailableVoiceFonts)
         else:
             sm.ScatterEvent('OnVoiceFontsReceived', self.voiceFontList)
开发者ID:Pluckyduck,项目名称:eve,代码行数:7,代码来源:vivoxService.py

示例7: OrderByTypeID

    def OrderByTypeID(self, orderlist):
        for each in orderlist:
            if len(each) == 4:
                typeID, wnd, size, itemID = each
                blueprint = BLUEPRINT_NONE
            else:
                typeID, wnd, size, itemID, blueprint = each
            if uicore.desktop.dpiScaling > 1.0:
                size = size * 2
            if wnd is None or wnd.destroyed:
                orderlist.remove(each)
                continue
            foundPath = self.ExistsInCacheOrRenders(typeID, size, itemID, blueprint)
            if foundPath:
                wnd.LoadTexture(foundPath)
                orderlist.remove(each)
                continue
            wnd.LoadTexture('res:/UI/Texture/notavailable.dds')

        for each in orderlist:
            self.byTypeIDQue.append(each)

        if not self.byTypeID_IsRunning:
            uthread.pool('photo::OrderByTypeID', self.ProduceTypeIDs)
            self.byTypeID_IsRunning = 1
开发者ID:connoryang,项目名称:dec-eve-serenity,代码行数:25,代码来源:evePhotosvc.py

示例8: PostStopEffectAction

 def PostStopEffectAction(self, effectID, dogmaItem, activationInfo, *args):
     dogmax.BaseDogmaLocation.PostStopEffectAction(self, effectID, dogmaItem, activationInfo, *args)
     if effectID == const.effectOnline:
         shipID = dogmaItem.locationID
         if shipID not in self.checkShipOnlineModulesPending:
             self.checkShipOnlineModulesPending.add(shipID)
             uthread.pool('LocationManager::CheckShipOnlineModules', self.CheckShipOnlineModules, shipID)
开发者ID:Pluckyduck,项目名称:eve,代码行数:7,代码来源:clientDogmaLocation.py

示例9: OnSlimItemUpdated

 def OnSlimItemUpdated(self, newItem):
     self.typeData['slimItem'] = newItem
     if self.wormholeSize != newItem.wormholeSize:
         self.LogInfo('Wormhole size has changed. Updating graphics')
         uthread.pool('wormhole:SetWormholeSize', self.SetWormholeSize, newItem.wormholeSize)
     if self.wormholeAge != newItem.wormholeAge:
         self.SetWobbleSpeed()
开发者ID:connoryang,项目名称:dec-eve-serenity,代码行数:7,代码来源:wormhole.py

示例10: OnTargetByOther

 def OnTargetByOther(self, otherID):
     sm.GetService("state").SetState(otherID, state.threatTargetsMe, 1)
     if otherID in self.targetedBy:
         self.LogError("already targeted by", otherID)
     else:
         self.targetedBy.append(otherID)
     bp = sm.GetService("michelle").GetBallpark()
     if bp is not None:
         slimItem = bp.GetInvItem(otherID)
         if slimItem is not None:
             if slimItem.ownerID:
                 self.ownerToShipIDCache[slimItem.ownerID] = otherID
     if bp is None or slimItem is None:
         if otherID not in self.pendingTargeters:
             self.pendingTargeters.append(otherID)
         return
     if otherID in self.pendingTargeters:
         self.pendingTargeters.remove(otherID)
     tgts = self.GetTargets().keys() + self.targeting.keys()
     if (
         otherID != eve.session.shipid
         and otherID not in tgts
         and otherID not in self.autoTargeting
         and min(
             settings.user.ui.Get("autoTargetBack", 1),
             sm.GetService("godma").GetItem(session.charid).maxLockedTargets,
             sm.GetService("godma").GetItem(session.shipid).maxLockedTargets,
         )
         > len(tgts)
     ):
         if len(self.autoTargeting) < settings.user.ui.Get("autoTargetBack", 1):
             self.autoTargeting.append(otherID)
             uthread.pool("TargetManages::OnTargetByOther-->LockTarget", self.LockTarget, otherID, autotargeting=1)
开发者ID:Reve,项目名称:eve,代码行数:33,代码来源:targetMgr.py

示例11: _mainThreadQueueFunc

def _mainThreadQueueFunc():
    import blue
    import uthread
    
    global MainThreadQueueRunning, MainThreadQueue, MainThreadQueueInvoker, MainThreadQueueInterval, MainThreadQueueItemDelay
    
    MainThreadQueueInvoker = None
    MainThreadQueueRunning = True
    while MainThreadQueueRunning:
        item = None
        if len(MainThreadQueue):
            item = MainThreadQueue.pop(0)
        
        if item:
            fn, args, kwargs = item
            
            def invoker():
                try:
                    fn(*args, **kwargs)
                except Exception:
                    showException()
            
            uthread.pool("MTQ", invoker)
            blue.pyos.synchro.Sleep(MainThreadQueueItemDelay)
        else:        
            blue.pyos.synchro.Sleep(MainThreadQueueInterval)
开发者ID:Toshimo-Kamiya,项目名称:shootbluesscripts,代码行数:26,代码来源:common.eve.py

示例12: RequestReset

 def RequestReset(self):
     self.validState = False
     if self.hideDesyncSymptoms:
         self.FlushSimulationHistory(newBaseSnapshot=False)
     else:
         self.RebaseStates(1)
     uthread.pool('michelle::UpdateStateRequest', self.remoteBallpark.UpdateStateRequest)
开发者ID:Pluckyduck,项目名称:eve,代码行数:7,代码来源:michelle.py

示例13: ShowInRangeTab

 def ShowInRangeTab(self):
     if not util.GetActiveShip():
         return None
     if self.sr.Get('showing', '') != 'inrange':
         self.sr.scroll.Load(contentList=[], noContentHint=localization.GetByLabel('UI/CapitalNavigation/CapitalNavigationWindow/CalculatingStellarDistancesMessage'))
         uthread.pool('form.CapitalNav::ShowInRangeTab', self.GetSolarSystemsInRange_thread, session.solarsystemid2)
         self.sr.showing = 'inrange'
开发者ID:connoryang,项目名称:dec-eve-serenity,代码行数:7,代码来源:capitalnavigation.py

示例14: _OnJoinedChannel

    def _OnJoinedChannel(self, channelName = 0):
        self.LogInfo('_OnJoinedChannel channelName', channelName)
        self.members[channelName] = []
        if channelName == 'Echo':
            sm.ScatterEvent('OnEchoChannel', True)
            self.SetSpeakingChannel('Echo')
            return
        eveChannelName = self.GetCcpChannelName(channelName)
        uthread.new(self.voiceMgr.LogChannelJoined, channelName).context = 'vivoxService::_OnJoinChannel::LogChannelJoined'
        eve.Message('CustomNotify', {'notify': localization.GetByLabel('UI/Voice/JoinedChannel', channel=self.GetPrettyChannelName(eveChannelName))})
        isRestrictedFleetChannel = False
        for each in [const.vcPrefixFleet, const.vcPrefixSquad, const.vcPrefixWing]:
            if each in channelName:
                if sm.GetService('fleet').GetChannelMuteStatus(eveChannelName) == True:
                    exclusionList = sm.GetService('fleet').GetExclusionList()
                    if exclusionList.has_key(eveChannelName) == False:
                        isRestrictedFleetChannel = True
                    elif exclusionList.has_key(eveChannelName) and session.charid not in exclusionList[eveChannelName]:
                        isRestrictedFleetChannel = True

        self.SetTabColor(channelName, 'listen')
        sm.ScatterEvent('OnVoiceChannelJoined', eveChannelName)
        if self.speakingChannel is None and isRestrictedFleetChannel == False:
            self.SetSpeakingChannel(eveChannelName)
        uthread.pool('vivox::_OnJoinedChannel', self.GetParticipants, channelName)
开发者ID:Pluckyduck,项目名称:eve,代码行数:25,代码来源:eveVivoxService.py

示例15: OnSessionReconnect

 def OnSessionReconnect(self):
     if self.LoggedIn():
         if settings.user.audio.Get('talkBinding', 4):
             self.EnableGlobalPushToTalkMode('talk')
         setattr(self, 'userSessionDisconnected', 0)
         for each in self.members.keys():
             uthread.pool('vivox::OnSessionReconnect', self.SetChannelOutputVolume, each, vivoxConstants.VXVOLUME_DEFAULT)
开发者ID:Pluckyduck,项目名称:eve,代码行数:7,代码来源:eveVivoxService.py


注:本文中的uthread.pool函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。