manager.py 文件源码

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

项目:pomu 作者: Hummer12007 项目源码 文件源码
def source(self, cls):
        """
        A decorator to mark package source modules
        It would register all the methods of the class marked by @handler
        with the dispatcher.
        """
        try:
            from pomu.source.base import BaseSource
        except ImportError: #circular import
            return cls
        if cls == BaseSource:
            return cls
        self.backends[cls.__name__] = cls
        for m, obj in inspect.getmembers(cls):
            if isinstance(obj, self.handler._handler):
                self.register_package_handler(cls, obj.handler, obj.priority)
        return cls
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号