From kpoman at gmail.com Tue Mar 17 21:47:03 2015 From: kpoman at gmail.com (Patricio Stegmann Gmail) Date: Tue, 17 Mar 2015 17:47:03 -0300 Subject: [Soap-Python] Decorating spyne's exposed service function Message-ID: <550892C7.4040405@gmail.com> Hello, I am trying to decorate (add function call logging) on a webservice created with spyne. See below: defa_decorator_passing_arbitrary_arguments(function_to_decorate): # The wrapper accepts any arguments defa_wrapper_accepting_arbitrary_arguments(*args, **kwargs): printargs, kwargs function_to_decorate(*args, **kwargs) returna_wrapper_accepting_arbitrary_arguments class SomeDummyService(ServiceBase): @a_decorator_passing_arbitrary_arguments @srpc(String_returns=String) def Hello(name='dude'): return"Hello "+str(name) When trying to start the app/service, I get this error: exception: reduce() of empty sequence with no initial value Could anyone give me a tip ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From burak.arslan at arskom.com.tr Thu Mar 26 09:24:19 2015 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Thu, 26 Mar 2015 10:24:19 +0200 Subject: [Soap-Python] Decorating spyne's exposed service function In-Reply-To: <550892C7.4040405@gmail.com> References: <550892C7.4040405@gmail.com> Message-ID: <5513C233.5030504@arskom.com.tr> Hi there, Sorry for the late answer, please use spyne ml. http://spyne.io/docs/2.9/faq.html#is-it-possible-to-use-other-decorators-with-rpc-srpc hth, burak On 03/17/15 22:47, Patricio Stegmann Gmail wrote: > Hello, > I am trying to decorate (add function call logging) on a webservice > created with spyne. See below: > > def a_decorator_passing_arbitrary_arguments(function_to_decorate): > # The wrapper accepts any arguments > def a_wrapper_accepting_arbitrary_arguments(*args, **kwargs): > print args, kwargs > function_to_decorate(*args, **kwargs) > return a_wrapper_accepting_arbitrary_arguments > > class SomeDummyService(ServiceBase): > @a_decorator_passing_arbitrary_arguments > @srpc(String _returns=String) > def Hello(name='dude'): > return "Hello "+str(name) > > When trying to start the app/service, I get this error: > > exception: reduce() of empty sequence with no initial value > > Could anyone give me a tip ? > > > _______________________________________________ > Soap mailing list > Soap at python.org > https://mail.python.org/mailman/listinfo/soap -------------- next part -------------- An HTML attachment was scrubbed... URL: