• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python uthread.pool函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Setup

    def Setup(self, moduleinfo):
        targetContainer = uiprimitives.Container(name='targetCont', align=uiconst.TOPLEFT, parent=self, top=0, height=64, width=64)
        slot = DefenceModuleButton(parent=targetContainer, idx=0)
        self.sr.targetIcon = uiutil.GetChild(targetContainer, 'iconSprite')
        self.sr.targetContainer = targetContainer
        self.sr.targetContainer.state = uiconst.UI_DISABLED
        sourceContainer = uiprimitives.Container(name='sourceCont', align=uiconst.TOPLEFT, parent=self, top=targetContainer.height + 22, height=64, width=64)
        slot = DefenceModuleButton(parent=sourceContainer, idx=0)
        self.sr.sourceIcon = uiutil.GetChild(sourceContainer, 'iconSprite')
        self.sr.sourceIcon.state = uiconst.UI_DISABLED
        self.sr.glow = uiutil.GetChild(sourceContainer, 'glow')
        self.sr.busy = uiutil.GetChild(sourceContainer, 'busy')
        self.sr.quantityParent = uiutil.GetChild(sourceContainer, 'quantityParent')
        self.sr.quantityParent.left = 8
        self.sr.quantityParent.width = 28
        idx = self.parent.children.index(self)
        fill = uiprimitives.Fill(parent=self, color=(1.0, 1.0, 1.0, 0.125), state=uiconst.UI_HIDDEN, idx=idx)
        self.sr.hilite = fill
        self.sr.sourceContainer = sourceContainer
        self.sr.sourceContainer.state = uiconst.UI_DISABLED
        chargeIcon = uicontrols.Icon(parent=sourceContainer, align=uiconst.RELATIVE, top=32, left=6, size=24, idx=0, state=uiconst.UI_HIDDEN, ignoreSize=True)
        self.sr.chargeIcon = chargeIcon
        if not len(self.__cgattrs__):
            self.__cgattrs__.extend([ a.attributeID for a in cfg.dgmattribs if cgre.match(a.attributeName) is not None ])
        self.sr.typeID = moduleinfo.typeID
        self.sr.moduleInfo = moduleinfo
        self.locationFlag = moduleinfo.flagID
        self.sr.sourceID = moduleinfo.itemID
        self.id = moduleinfo.itemID
        self.sr.glow.z = 0
        self.sr.qtylabel = uicontrols.Label(text='', parent=self.sr.quantityParent, width=30, state=uiconst.UI_DISABLED, idx=0, fontsize=9)
        self.sr.distancelabel = uicontrols.EveHeaderSmall(text='', parent=self.sr.targetContainer, left=12, top=-16, width=70, state=uiconst.UI_DISABLED, idx=0)
        if cfg.IsChargeCompatible(moduleinfo):
            self.invCookie = sm.GetService('inv').Register(self)
        self.SetCharge(None)
        for key in moduleinfo.effects.iterkeys():
            effect = moduleinfo.effects[key]
            if self.IsEffectActivatible(effect):
                self.def_effect = effect
                if effect.isActive:
                    self.SetActive()
            if effect.effectName == 'online':
                if effect.isActive:
                    self.ShowOnline()
                else:
                    self.ShowOffline()

        self.state = uiconst.UI_NORMAL
        currentTarget = self.GetCurrentTarget()
        if currentTarget is not None:
            uthread.pool('DefenceMobuleButton::OnTargetAdded::', self.OnTargetAdded, currentTarget)
        self.sr.sourceUpdateTimer = base.AutoTimer(random.randint(750, 1000), self.UpdateData, 'source')
        self.UpdateData('source')
        self.sr.targetUpdateTimer = base.AutoTimer(random.randint(750, 1000), self.UpdateData, 'target')
        self.UpdateData('target')
        self.UpdateDistance()
        self.sr.distanceUpdateTimer = base.AutoTimer(random.randint(5000, 6000), self.UpdateDistance)
        self.EnableDrag()
        uthread.new(self.BlinkIcon)
开发者ID:connoryang,项目名称:dec-eve-serenity,代码行数:59,代码来源:moondefencebutton.py


示例17: OnSlimItemChange

 def OnSlimItemChange(self, oldItem, newItem):
     if oldItem.itemID != self.id:
         return
     if oldItem.wormholeSize != newItem.wormholeSize:
         self.LogInfo('Wormhole size has changed. Updating graphics')
         uthread.pool('wormhole:SetWormholeSize', self.SetWormholeSize, oldItem.wormholeSize, newItem.wormholeSize)
     if oldItem.wormholeAge != newItem.wormholeAge:
         self.SetWobbleSpeed()
开发者ID:Pluckyduck,项目名称:eve,代码行数:8,代码来源:wormhole.py


示例18: MouseEnter

 def MouseEnter(self, *args):
     if self.destroyed or sm.GetService('godma').GetItem(self.sr.moduleInfo.itemID) is None:
         return
     log.LogInfo('Module.OnMouseEnter', self.sr.sourceID)
     eve.Message('NeocomButtonEnter')
     self.ShowAccuracy()
     self.sr.accuracyTimer = base.AutoTimer(1000, self.ShowAccuracy)
     uthread.pool('ShipMobuleButton::OnMouseEnter-->UpdateTargetingRanges', sm.GetService('tactical').UpdateTargetingRanges, self.sr.moduleInfo)
开发者ID:connoryang,项目名称:dec-eve-serenity,代码行数:8,代码来源:moondefencebutton.py


示例19: OnMultiSelect

 def OnMultiSelect(self, itemIDs):
     self.itemIDs = itemIDs
     self.lastActionSerial = None
     self.lastActionDist = None
     self.lastBountyCheck = None
     self.bounty = None
     if self.ImVisible():
         uthread.pool('ActiveItem::UpdateAll', self.UpdateAll, 1)
开发者ID:connoryang,项目名称:dec-eve-serenity,代码行数:8,代码来源:activeitem.py


示例20: OnMouseEnter

 def OnMouseEnter(self, *args):
     if self is None or self.destroyed or self.parent is None or self.parent.destroyed:
         return
     if not self.blockDisable and not uicore.cmd.IsUIHidden():
         uicore.layer.main.state = uiconst.UI_PICKCHILDREN
     if sm.IsServiceRunning('tactical'):
         uthread.pool('InflightNav::MouseEnter --> ResetTargetingRanges', sm.GetService('tactical').ResetTargetingRanges)
     uiutil.SetOrder(self, -1)
开发者ID:Pluckyduck,项目名称:eve,代码行数:8,代码来源:navigation.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python uthread.worker函数代码示例发布时间:2022-05-27
下一篇:
Python uthread.new函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap