@ladonize decorator does not play well with decorated class methods

Bug #877727 reported by David Ignacio
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ladon
New
High
jsgaarde

Bug Description

you cannot @ladonize a class mathod that is already decorated.

ladon.ladonizer.collection.LadonServiceCollection does some analysis of the code to determine which service class the current method belongs to in source_info and add_service_method. if a class method is already decorated, then add_service_method returns None.

Revision history for this message
David Ignacio (deignacio) wrote :
Revision history for this message
David Ignacio (deignacio) wrote :

after trying to decorate my decorators as noted here: http://micheles.googlecode.com/hg/decorator/documentation.html

a different exception is raised:

  File "/Users/dignacio/Documents/workspace/ladon/ladon_service.py", line 14, in <module>
    class LadonSoapService(object):
  File "/Users/dignacio/Documents/workspace/ladon/ladon_service.py", line 21, in LadonSoapService
    @mydecorator
  File "/Users/dignacio/Documents/workspace/ladon/virtualenv/lib/python2.7/site-packages/ladon/ladonizer/decorator.py", line 88, in decorator
    ladon_method_info = global_service_collection().add_service_method(f,*def_args,**def_kw)
  File "/Users/dignacio/Documents/workspace/ladon/virtualenv/lib/python2.7/site-packages/ladon/ladonizer/collection.py", line 119, in add_service_method
    sinfo = self.source_info(src_fname)
  File "/Users/dignacio/Documents/workspace/ladon/virtualenv/lib/python2.7/site-packages/ladon/ladonizer/collection.py", line 75, in source_info
    src_fp = open(fname,'rb')
IOError: [Errno 2] No such file or directory: '<string>'
make: *** [run] Error 1

Revision history for this message
jsgaarde (jakob-simon-gaarde) wrote :

Hi David.

Thanks for reporting this, I don't even think I ever tried decorating a ladonize-decorated method before. I will look into the matter and see if I can do anything about it.

Best Regards Jakob Simon-Gaarde

Changed in ladon:
importance: Undecided → High
assignee: nobody → jsgaarde (jakob-simon-gaarde)
Revision history for this message
azurit (azurit) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.