Commit c6fab535 authored by Vincent Pelletier's avatar Vincent Pelletier

Replace __getattr__ + __[sg]etitem__ calls by a single __[sg]etattr__ call.

Also, provide one argument per line.
Also, avoid shadowing "id" built-in.
parent 2fa6bfeb
...@@ -467,22 +467,27 @@ class ActiveWrapper: ...@@ -467,22 +467,27 @@ class ActiveWrapper:
def __init__(self, portal_activities, passive_self, activity, active_process, kw, request): def __init__(self, portal_activities, passive_self, activity, active_process, kw, request):
# second parameter can be an object or an object's path # second parameter can be an object or an object's path
self.__dict__['__portal_activities'] = portal_activities self.__portal_activities = portal_activities
self.__dict__['__passive_self'] = passive_self self.__passive_self = passive_self
self.__dict__['__activity'] = activity self.__activity = activity
self.__dict__['__active_process'] = active_process self.__active_process = active_process
self.__dict__['__kw'] = kw self.__kw = kw
self.__dict__['__request'] = request self.__request = request
def __getattr__(self, id): def __getattr__(self, name):
return Method(self.__dict__['__portal_activities'], return Method(
self.__dict__['__passive_self'], self.__dict__['__activity'], self.__portal_activities,
self.__dict__['__active_process'], self.__passive_self,
self.__dict__['__kw'], id, self.__dict__['__request']) self.__activity,
self.__active_process,
self.__kw,
name,
self.__request,
)
def __repr__(self): def __repr__(self):
return '<%s at 0x%x to %r>' % (self.__class__.__name__, id(self), return '<%s at 0x%x to %r>' % (self.__class__.__name__, id(self),
self.__dict__['__passive_self']) self.__passive_self)
# True when activities cannot be executing any more. # True when activities cannot be executing any more.
has_processed_shutdown = False has_processed_shutdown = False
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment