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

Python g_logOutput.debug函数代码示例

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

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



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


示例16: sendEventToServer

def sendEventToServer(eventType, host, port, errorCode=0, errorDescr="", tries=1):
    sender = getattr(BigWorld.player(), "logXMPPEvents", None)
    if not sender or not callable(sender):
        return
    address = "{0}:{1}".format(host, port)
    currentTime = time.time()
    g_logOutput.debug(
        CLIENT_LOG_AREA.GENERIC,
        "Sends log to server",
        [eventType, currentTime, errorCode, tries],
        [address, errorDescr],
    )
    try:
        sender([eventType, currentTime, errorCode, tries], [address, errorDescr])
    except:
        LOG_CURRENT_EXCEPTION()
开发者ID:kblw,项目名称:wot_client,代码行数:16,代码来源:logger.py


示例17: __handleDisconnect

 def __handleDisconnect(self, reason, description):
     client = self.client()
     if not client:
         return 
     g_logOutput.debug(CLIENT_LOG_AREA.CONNECTION, 'Client is disconnected')
     self.__cancelReconnectCallback()
     self.__cancelReqTokenCallback()
     if reason == DISCONNECT_REASON.AUTHENTICATION:
         self.__tokenRequester.clear()
     if self.isInGameServer() and reason != DISCONNECT_REASON.BY_REQUEST:
         delay = self.__connectionsInfo.getNextDelay()
         self.__reconnectCallbackID = BigWorld.callback(delay, self.__doNextConnect)
         g_logOutput.debug(CLIENT_LOG_AREA.CONNECTION, 'Will try to reconnect after {0} seconds'.format(delay), description)
         (host, port,) = self.__connectionsInfo.getLastAddress()
         tries = self.__connectionsInfo.getTries()
         sendEventToServer(XMPP_EVENT_LOG.DISCONNECT, host, port, reason, description, tries)
开发者ID:Infernux,项目名称:Projects,代码行数:16,代码来源:connection.py


示例18: __doConnect

 def __doConnect(self):
     client = self.client()
     if not client.isDisconnected():
         g_logOutput.warning(CLIENT_LOG_AREA.CONNECTION, 'Client already is connected(ing)', client.getConnectionAddress(), client.getConnectionState())
         return
     jid = self.__connectionsInfo.getPlayerFullJID()
     if jid:
         cType, host, port = self.__connectionsInfo.getNextConnection()
         g_logOutput.debug(CLIENT_LOG_AREA.CONNECTION, 'Connect to XMPP sever', jid, host, port)
         if cType == CONNECTION_IMPL_TYPE.TCP:
             client.connect(str(jid), host, port)
         elif cType == CONNECTION_IMPL_TYPE.BOSH:
             client.connectBosh(str(jid), host, port, '/bosh/')
         else:
             g_logOutput.error(CLIENT_LOG_AREA.CONNECTION, 'This type of connection is not supported', cType)
     else:
         g_logOutput.error(CLIENT_LOG_AREA.CONNECTION, 'JID is empty')
开发者ID:aevitas,项目名称:wotsdk,代码行数:17,代码来源:xmppconnection.py


示例19: onMessageReceived

 def onMessageReceived(self, jid, body, _, info, sentAt):
     dbID = info['dbID']
     name = info['name']
     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 massage is ignored", jid, name)
             return
     search = entities.XMPPChatChannelEntity(jid, name)
     channel = self.channelsStorage.getChannel(search)
     if not channel:
         channel = self._addChannel(search, dbID, name, True)
         if not channel:
             return
         self.__sessions.add(jid)
     if body:
         g_messengerEvents.channels.onMessageReceived(XMPPMessageData(dbID, name, body, sentAt), channel)
开发者ID:krzcho,项目名称:WOTDecompiled,代码行数:17,代码来源:messages.py


示例20: __handlePresence

 def __handlePresence(self, jid, resource):
     dbID = jid.getDatabaseID()
     user = self.usersStorage.getUser(dbID, PROTO_TYPE.XMPP)
     if resource.presence == PRESENCE.UNAVAILABLE:
         if user and not user.isCurrentPlayer():
             user.update(jid=jid, resource=None, clanInfo=resource.getClanInfo())
             g_logOutput.debug(_LOG.RESOURCE, 'Resource is removed', user.getName(), jid.getResource(), resource)
     elif resource.presence != PRESENCE.UNKNOWN:
         if not user:
             user = entities.XMPPUserEntity(dbID)
             self.usersStorage.setUser(user)
         if user.isCurrentPlayer():
             self.playerCtx.setBanInfo(resource.getBanInfo())
         else:
             user.update(jid=jid, resource=resource, clanInfo=resource.getClanInfo())
             g_logOutput.debug(_LOG.RESOURCE, 'Resource is set', user.getName(), jid.getResource(), resource)
     if user:
         g_messengerEvents.users.onUserStatusUpdated(user)
     return
开发者ID:krzcho,项目名称:WOTDecompiled,代码行数:19,代码来源:__init__.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python g_logOutput.error函数代码示例发布时间:2022-05-27
下一篇:
Python jid.makeContactJID函数代码示例发布时间: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