notify.py 文件源码

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

项目:core-framework 作者: RedhawkSDR 项目源码 文件源码
def notify(self, *args, **kwargs):
        """
        Call all listener callbacks. The wrapped function is not executed.
        """
        for listener in self.nm_listeners:
            # Ensure that all callbacks get called, and no exceptions escape to
            # the caller.
            try:
                listener(*args, **kwargs)
            except:
                # If the target is a notify_callback--which should always be
                # the case as long as the proper API is used--show the actual
                # function
                target = getattr(listener, 'nc_func', listener)
                print >>sys.stderr, 'Exception in notification %s:' % (repr(target),)
                traceback.print_exception(*sys.exc_info())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号