amp.py 文件源码

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

项目:landscape-client 作者: CanonicalLtd 项目源码 文件源码
def __getattr__(self, name):
        """
        Pass attributes through to the real L{BrokerServer}, after checking
        that they're encodable with AMP.
        """
        original = getattr(self.broker_server, name, None)
        if (name in get_remote_methods(self.broker_server) and
            original is not None and
            callable(original)
            ):
            def method(*args, **kwargs):
                for arg in args:
                    assert MethodCallArgument.check(arg)
                for k, v in iteritems(kwargs):
                    assert MethodCallArgument.check(v)
                return execute(original, *args, **kwargs)
            return method
        else:
            raise AttributeError(name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号