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


Python g_logOutput.debug函数代码示例

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


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

示例1: __addContactToXmppRoster

 def __addContactToXmppRoster(self, jid, userName = 'Unknown', groups = None):
     if not GROUPS_SYNC_ENABLED:
         groups = None
     client = self.client()
     g_logOutput.debug(CLIENT_LOG_AREA.SYNC, 'Adds contact from BW roster and sends request to add subscription', jid, userName, groups)
     client.setContactToRoster(jid, userName, groups)
     client.setSubscribeTo(jid)
开发者ID:Infernux,项目名称:Projects,代码行数:7,代码来源:updaters.py

示例2: sync

    def sync(self):
        if self.__isBWRosterReceived and self.client().isConnected():
            g_logOutput.debug(CLIENT_LOG_AREA.SYNC, 'Syncing XMPP rosters from BW')
            domain = g_settings.server.XMPP.domain
            contacts = set()
            for user in self.usersStorage.getList(_BWRosterFindCriteria()):
                jid = ContactBareJID()
                jid.setNode(user.getID())
                jid.setDomain(domain)
                contacts.add(jid)
                if user.isCurrentPlayer():
                    self.xmppRoster[jid].name = user.getName()
                    continue
                groups = self.__getBWRosterGroups(user)
                if self.xmppRoster.hasItem(jid):
                    if GROUPS_SYNC_ENABLED and groups ^ self.xmppRoster[jid].groups:
                        self.__setContactToXmppRoster(jid, user.getName(), groups)
                    if self.xmppRoster[jid].subscriptionTo == SUBSCRIPTION.OFF:
                        self.__setSubscribeTo(jid)
                else:
                    self.__addContactToXmppRoster(jid, user.getName(), groups)

            toRemove = set(self.xmppRoster.keys()).difference(contacts)
            for jid in toRemove:
                contact = self.xmppRoster[jid]
                if contact.subscriptionFrom != SUBSCRIPTION.OFF:
                    if contact.subscriptionTo == SUBSCRIPTION.ON:
                        self.__removeSubscribeTo(jid)
                else:
                    self.__removeContactFromXmppRoster(jid)
开发者ID:Infernux,项目名称:Projects,代码行数:30,代码来源:updaters.py

示例3: __handleRosterResourceRemoved

 def __handleRosterResourceRemoved(self, jid):
     user = self.usersStorage.getUser(jid.getDatabaseID(), PROTO_TYPE.XMPP)
     if user and not user.isCurrentPlayer():
         user.update(jid=jid, resource=None)
         g_logOutput.debug(CLIENT_LOG_AREA.RESOURCE, 'Resource is removed', jid.getResource(), user.getName())
         g_messengerEvents.users.onUserStatusUpdated(user)
     return
开发者ID:webiumsk,项目名称:WoT,代码行数:7,代码来源:__init__.py

示例4: connect

 def connect(self):
     if self.__reconnectCallbackID is None:
         self.__connectionsInfo.init()
         self.__doConnect()
     else:
         g_logOutput.debug(CLIENT_LOG_AREA.CONNECTION, 'Connection already is processing')
     return
开发者ID:aevitas,项目名称:wotsdk,代码行数:7,代码来源:xmppconnection.py

示例5: __addToLocalXmppRoster

 def __addToLocalXmppRoster(self, jid, name, groups, to, from_):
     if self.xmppRoster.hasItem(jid):
         g_logOutput.debug(CLIENT_LOG_AREA.SYNC, 'Updating item in local XMPP roster', jid, name, groups, to, from_)
         self.xmppRoster[jid].update(name, groups, to, from_)
     else:
         g_logOutput.debug(CLIENT_LOG_AREA.SYNC, 'Adding item to local XMPP roster', jid, name, groups, to, from_)
         self.xmppRoster[jid] = RosterItem(jid, name, groups, to, from_)
开发者ID:Infernux,项目名称:Projects,代码行数:7,代码来源:updaters.py

示例6: addMessage

 def addMessage(self, jid, message):
     if message.isHistory():
         self.__historyRQ.addHistory(message)
         return
     dbID = message.accountDBID
     name = message.accountName
     if jid not in self.__sessions and g_settings.userPrefs.chatContactsListOnly:
         contact = self.usersStorage.getUser(dbID)
         if not contact or not USER_TAG.filterClosedContactsTags(contact.getTags()):
             g_logOutput.debug(
                 CLIENT_LOG_AREA.MESSAGE,
                 "There is not closed contact in player's contacts list,contact's message is ignored",
                 jid,
                 name,
             )
             return
     search = entities.XMPPChatChannelEntity(jid, name)
     channel = self.channelsStorage.getChannel(search)
     if not channel:
         channel = self._addChannel(search, dbID, name)
         if not channel:
             return
         self.__sessions.add(jid)
     if message.body:
         g_messengerEvents.channels.onMessageReceived(message, channel)
开发者ID:webiumsk,项目名称:WOT-0.9.12,代码行数:25,代码来源:messages.py

示例7: __onSeqsInited

 def __onSeqsInited(self):
     g_logOutput.debug(_LOG.GENERIC, 'Starts to process contacts tasks')
     self.__presence.sendPresence(True)
     self.__tasks.release()
     self.__tasks.onSeqTaskRequested += self.__onSeqTaskRequested
     self.__subsRestrictions.setToUseCachedCounts(True)
     self.__subsBatch.process(self.__tasks)
     self.__subsRestrictions.setToUseCachedCounts(False)
     g_messengerEvents.users.onUsersListReceived({USER_TAG.FRIEND, USER_TAG.IGNORED, USER_TAG.MUTED})
开发者ID:webiumsk,项目名称:WOT-0.9.15-CT,代码行数:9,代码来源:__init__.py

示例8: __handleRosterResourceAdded

 def __handleRosterResourceAdded(self, jid, resource):
     dbID = jid.getDatabaseID()
     user = self.usersStorage.getUser(dbID, PROTO_TYPE.XMPP)
     if not user:
         user = entities.XMPPUserEntity(dbID)
         self.usersStorage.setUser(user)
     if not user.isCurrentPlayer():
         user.update(jid=jid, resource=resource)
         g_logOutput.debug(CLIENT_LOG_AREA.RESOURCE, 'Resource is set', user.getName(), jid.getResource(), resource)
         g_messengerEvents.users.onUserStatusUpdated(user)
开发者ID:webiumsk,项目名称:WoT,代码行数:10,代码来源:__init__.py

示例9: _doSync

 def _doSync(self, name, groups = None, sub = None, clanInfo = None):
     user = self._getUser()
     if not user or user.isCurrentPlayer():
         return user
     if user.getItemType() == XMPP_ITEM_TYPE.ROSTER_ITEM:
         user.update(item=None)
         _syncEmptyGroups(self.usersStorage, self._groups)
         g_logOutput.debug(CLIENT_LOG_AREA.ROSTER, 'Roster item is removed', user)
         self._doNotify(USER_ACTION_ID.FRIEND_REMOVED, user)
     return user
开发者ID:kblw,项目名称:wot_client,代码行数:10,代码来源:roster_tasks.py

示例10: _doRun

 def _doRun(self, client):
     user = self._getUser()
     if user and user.getItemType() in XMPP_ITEM_TYPE.TMP_BLOCKING_LIST:
         user.update(item=None)
         user.removeTags({USER_TAG.MUTED})
         g_logOutput.debug(CLIENT_LOG_AREA.BLOCK_LIST, 'Temporary block item is removed', self._jid, {'name': self._name})
         self._doNotify(USER_ACTION_ID.TMP_IGNORED_REMOVED, user)
         self._doNotify(USER_ACTION_ID.MUTE_UNSET, user, False)
     self._result = TASK_RESULT.REMOVE
     return
开发者ID:aevitas,项目名称:wotsdk,代码行数:10,代码来源:contactsblock_tasks.py

示例11: set

 def set(self, pyGlooxTag):
     result = blocking_cmd.BlockItemHandler().handleTag(pyGlooxTag)
     jid, info = findFirst(None, result, ('', {}))
     if jid != self._jid:
         return
     user = _syncBlockItem(self.usersStorage, self._jid, **info)
     if user:
         g_logOutput.debug(CLIENT_LOG_AREA.BLOCK_LIST, 'Block item is added', jid, info)
         self._doNotify(USER_ACTION_ID.IGNORED_ADDED, user)
         self._doNotify(USER_ACTION_ID.MUTE_SET, user, False)
     self._result = TASK_RESULT.REMOVE
开发者ID:kblw,项目名称:wot_client,代码行数:11,代码来源:block_tasks.py

示例12: __handleTokenError

 def __handleTokenError(self):
     client = self.client()
     if not client:
         return
     if self.__reqTokenBackOff.getTries() < _MAX_REQ_TOKEN_TRIES:
         delay = self.__reqTokenBackOff.next()
         self.__reqTokenCallbackID = BigWorld.callback(delay, self.__doNextLogin)
         g_logOutput.debug(CLIENT_LOG_AREA.TOKEN, 'Will try to request token after {0} seconds'.format(delay))
     else:
         self.client().disconnect()
         self.__handleDisconnect(DISCONNECT_REASON.OTHER_ERROR, 'Received chat token is not valid')
开发者ID:krzcho,项目名称:WOTDecompiled,代码行数:11,代码来源:connection.py

示例13: __handlePresenceWithIGR

 def __handlePresenceWithIGR(self, jid, resource):
     dbID = jid.getDatabaseID()
     user = self.usersStorage.getUser(dbID, PROTO_TYPE.XMPP)
     if user and user.isCurrentPlayer():
         return
     if not user:
         user = entities.XMPPUserEntity(dbID)
         self.usersStorage.setUser(user)
     user.update(jid=jid, resource=resource)
     g_logOutput.debug(CLIENT_LOG_AREA.RESOURCE, 'Resource with IGR is set', user.getName(), jid.getResource(), resource)
     g_messengerEvents.users.onUserActionReceived(USER_ACTION_ID.IGR_CHANGED, user)
开发者ID:webiumsk,项目名称:WoT,代码行数:11,代码来源:__init__.py

示例14: _populate

    def _populate(self, taskQueue):
        jids = []
        while self._cancelTasks:
            jid, tasks = self._cancelTasks.popitem()
            jids.append(jid)
            if taskQueue.addTasks(jid, *tasks):
                taskQueue.runFirstTask(jid)

        if jids:
            g_logOutput.debug(_LOG.SUBSCRIPTION, 'Inbound subscriptions are canceled automatically', jids[:10])
            jids = []
        while self._approveTasks:
            jid, tasks = self._approveTasks.popitem()
            jids.append(jid)
            if taskQueue.addTasks(jid, *tasks):
                taskQueue.runFirstTask(jid)

        if jids:
            g_logOutput.debug(_LOG.SUBSCRIPTION, 'Inbound subscriptions are approved automatically', jids[:10])
        if self._newRqs:
            g_logOutput.debug(_LOG.SUBSCRIPTION, 'New inbound subscriptions are received', self._newRqs[:10])
            g_messengerEvents.users.onFriendshipRequestsAdded(self._newRqs)
        if self._oldRqs:
            g_logOutput.debug(_LOG.SUBSCRIPTION, 'Inbound subscriptions are ignored to display', self._oldRqs[:10])
            g_messengerEvents.users.onFriendshipRequestsUpdated(self._oldRqs)
开发者ID:webiumsk,项目名称:WOT-0.9.15-CT,代码行数:25,代码来源:sub_helper.py

示例15: _doSync

 def _doSync(self, name, groups = None, sub = None, clanInfo = None):
     user = self._getUser()
     if not user or user.isCurrentPlayer():
         return user
     if user.getItemType() in XMPP_ITEM_TYPE.ROSTER_ITEMS:
         user.update(item=ContactItem(user.getJID()))
         _syncEmptyGroups(self.usersStorage, self._groups)
         g_logOutput.debug(CLIENT_LOG_AREA.ROSTER, 'Roster item is removed', user)
         self._doNotify(USER_ACTION_ID.FRIEND_REMOVED, user)
     elif user.getItemType() in XMPP_ITEM_TYPE.SUB_PENDING_ITEMS:
         user.update(item=ContactItem(user.getJID()))
         _syncEmptyGroups(self.usersStorage, self._groups)
         g_logOutput.debug(CLIENT_LOG_AREA.ROSTER, 'Friendship request is revoked by sender', user)
         g_messengerEvents.users.onFriendshipRequestsUpdated([user])
     return user
开发者ID:aevitas,项目名称:wotsdk,代码行数:15,代码来源:contactsroster_tasks.py


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