Commit 43ab06c9 authored by Vincent Pelletier's avatar Vincent Pelletier

Use single-underscore property prefix.

For easier debugging, so we don't have to know how python mangles
double-underscore properties, as introspection is reduced by __slots__
usage.
Suggested by Julien Muchembled <jm@nexedi.com>
parent fda3f093
...@@ -436,47 +436,47 @@ Named Parameters: %r ...@@ -436,47 +436,47 @@ Named Parameters: %r
class Method(object): class Method(object):
__slots__ = ( __slots__ = (
'__portal_activities', '_portal_activities',
'__passive_url', '_passive_url',
'__passive_oid', '_passive_oid',
'__activity', '_activity',
'__active_process', '_active_process',
'__active_process_uid', '_active_process_uid',
'__kw', '_kw',
'__method_id', '_method_id',
'__request', '_request',
) )
def __init__(self, portal_activities, passive_url, passive_oid, activity, def __init__(self, portal_activities, passive_url, passive_oid, activity,
active_process, active_process_uid, kw, method_id, request): active_process, active_process_uid, kw, method_id, request):
self.__portal_activities = portal_activities self._portal_activities = portal_activities
self.__passive_url = passive_url self._passive_url = passive_url
self.__passive_oid = passive_oid self._passive_oid = passive_oid
self.__activity = activity self._activity = activity
self.__active_process = active_process self._active_process = active_process
self.__active_process_uid = active_process_uid self._active_process_uid = active_process_uid
self.__kw = kw self._kw = kw
self.__method_id = method_id self._method_id = method_id
self.__request = request self._request = request
def __call__(self, *args, **kw): def __call__(self, *args, **kw):
portal_activities = self.__portal_activities portal_activities = self._portal_activities
m = Message( m = Message(
url=self.__passive_url, url=self._passive_url,
oid=self.__passive_oid, oid=self._passive_oid,
active_process=self.__active_process, active_process=self._active_process,
active_process_uid=self.__active_process_uid, active_process_uid=self._active_process_uid,
activity_kw=self.__kw, activity_kw=self._kw,
method_id=self.__method_id, method_id=self._method_id,
args=args, args=args,
kw=kw, kw=kw,
request=self.__request, request=self._request,
portal_activities=portal_activities, portal_activities=portal_activities,
) )
if portal_activities.activity_tracking: if portal_activities.activity_tracking:
activity_tracking_logger.info('queuing message: activity=%s, object_path=%s, method_id=%s, args=%s, kw=%s, activity_kw=%s, user_name=%s' % (self.__activity, '/'.join(m.object_path), m.method_id, m.args, m.kw, m.activity_kw, m.user_name)) activity_tracking_logger.info('queuing message: activity=%s, object_path=%s, method_id=%s, args=%s, kw=%s, activity_kw=%s, user_name=%s' % (self._activity, '/'.join(m.object_path), m.method_id, m.args, m.kw, m.activity_kw, m.user_name))
portal_activities.getActivityBuffer().deferredQueueMessage( portal_activities.getActivityBuffer().deferredQueueMessage(
portal_activities, activity_dict[self.__activity], m) portal_activities, activity_dict[self._activity], m)
allow_class(Method) allow_class(Method)
......
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