Created
June 23, 2014 19:37
-
-
Save trecouvr/7f26bd20c52026b1c6e0 to your computer and use it in GitHub Desktop.
spyne classmethod
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class A(ServiceBase): | |
| @rpc(String, _returns=String, _no_cls=False) | |
| def hello(cls, ctx, name): | |
| print(name, cls) | |
| return cls._hello(name) | |
| @classmethod | |
| def _hello(cls, name): | |
| return 'Hello, %s' % name | |
| class B(A): | |
| @classmethod | |
| def _hello(cls, name): | |
| return 'Bello, %s' % name | |
| app = Application([B], name='Service', tns='my.ns.roxx', ..) | |
| # client | |
| client.service.hello('tom') | |
| # >>> Bello, tom |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment