from functools import update_wrapper
class cls_wrapper:
def __init__(self, wrapped):
self.wrapped = wrapped
update_wrapper(self, wrapped)
def __call__(self, *args, **kwargs):
print('Calling from the class decorator.')
return self.wrapped(*args, **kwargs)
@cls_wrapper(args)
def func(x,y):
print('Calling from the function.')
print(x,y)
func(1,2)
collections_from_fixtures =[(
update.find('id').text,
'default' if update.find('.//module') is None
else update.find('.//module').attrib['name']
) for update in self.update_info_fixtures.findall(
'.//update')]