[spyne] Spyne @mrpc problem

Burak Arslan burak.arslan at arskom.com.tr
Wed Dec 24 19:24:14 UTC 2014


On 12/24/14 21:21, Патрин Павел wrote:
> I think that @mrpc will allow me to access a service class.
> I want to call a static method from service method (it is a synthetic
> example):

That's not what @mrpc is for. It's part of the totally undocumented
HATEOAS api. one day, I'll spill all the beans about those ~5k commits :)

>  
> class TimerService(ServiceBase):
>  
>     @staticmethod
>     def _handle_work_time(username):
>         # Here is some logic.
>         pass
>  
>     @mrpc(Unicode)
>     def save_work_time(cls, ctx, username):
>         cls._handle_work_time(unicode(username))
>    
>  
> Ii could achieve a same effect with @rpc decorator and
> ctx.service_class._handle_work_time(username) code, but it is ugly.

Why not just do TimerService._handle_work_time(username)?





More information about the people mailing list