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
评论列表
文章目录