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