dbussy.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:dbussy 作者: ldo 项目源码 文件源码
def _rule_action_match(self, message, _) :
        # installed as a message filter to invoke actions corresponding to rules
        # that the message matches. To avoid spurious method-not-handled errors
        # from eavesdropping on method calls not addressed to me, this routine
        # always returns a “handled” status. That means this same Connection
        # object should not be used for both eavesdropping and for normal
        # method calls.
        handled = False
        for entry in self._match_actions.values() :
            if matches_rule(message, entry.rule) :
                for action in entry.actions :
                    result = action.func(self, message, action.user_data)
                    if isinstance(result, types.CoroutineType) :
                        assert self.loop != None, "no event loop to attach coroutine to"
                        self.loop.create_task(result)
                    #end if
                #end for
                handled = True # passed to at least one handler
            #end if
        #end for
        return \
            (DBUS.HANDLER_RESULT_NOT_YET_HANDLED, DBUS.HANDLER_RESULT_HANDLED)[handled]
    #end _rule_action_match
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号