python - ladon throwing an AttributeError -


i'm trying ladon working, however, don't seem able define service properly.

specifically, minimal test case, it's throwing

traceback (most recent call last):   file "c:\python33\lib\site-packages\ladon\server\wsgi_application.py", line 332, in __call__     self.import_services(self.service_list)   file "c:\python33\lib\site-packages\ladon\server\wsgi_application.py", line 288, in import_services     __import__(service)   file "d:\workspaces\python\soapmanager.py", line 20, in <module>     @ladonize(portable_string, portable_string, rtype=portable_string)   file "c:\python33\lib\site-packages\ladon\ladonizer\decorator.py", line 118, in decorator     injector.__doc__ = ladon_method_info._doc attributeerror: 'nonetype' object has no attribute '_doc' 

my run.py contains:

from ladon.server.wsgi import ladonwsgiapplication os.path import abspath, dirname wsgiref.simple_server import make_server   application = ladonwsgiapplication(     ['soapmanager'],     [dirname(abspath(__file__))],     catalog_name='api',     catalog_desc='api description')  httpd = make_server('0.0.0.0', 8004, application) print("listening on port 8004...")  # respond requests until process killed httpd.serve_forever() 

and minimal test case in soapmanager.py:

from ladon.ladonizer import ladonize ladon.types.ladontype import ladontype ladon.compat import portable_string  @ladonize(portable_string, portable_string, rtype=portable_string) def authenticate(username, password):     return "test" 

the error being raised within ladonize decorator. seems occuring when trying build definition of service. specifically, in ladon decorator calls collection.add_service_method returns none instead of method. think it's failing line-number check.

firstlineno = f.__code__.co_firstlineno # ast-analyzed object of source file sinfo = self.source_info(src_fname) ... clsname,v in sinfo.items():     if firstlineno>v[0] , firstlineno<=v[1]: 

for reason check failing method defaults returning none.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -