rename registered to __registered__
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 13 Aug 2009 11:54:19 +0200
changeset 2820 66b31686d92b
parent 2819 b864288fd316
child 2821 526f44213b70
rename registered to __registered__
appobject.py
server/hooksmanager.py
vregistry.py
web/views/actions.py
--- a/appobject.py	Thu Aug 13 11:49:56 2009 +0200
+++ b/appobject.py	Thu Aug 13 11:54:19 2009 +0200
@@ -245,7 +245,7 @@
         return '%s.%s' % (cls.__module__, cls.__name__)
 
     @classmethod
-    def registered(cls, registry):
+    def __registered__(cls, registry):
         """called by the registry when the appobject has been registered.
 
         It must return the object that will be actually registered (this may be
--- a/server/hooksmanager.py	Thu Aug 13 11:49:56 2009 +0200
+++ b/server/hooksmanager.py	Thu Aug 13 11:54:19 2009 +0200
@@ -217,8 +217,8 @@
         self.event = event
 
     @classmethod
-    def registered(cls, vreg):
-        super(Hook, cls).registered(vreg)
+    def __registered__(cls, vreg):
+        super(Hook, cls).__registered__(vreg)
         return cls()
 
     @classmethod
--- a/vregistry.py	Thu Aug 13 11:49:56 2009 +0200
+++ b/vregistry.py	Thu Aug 13 11:54:19 2009 +0200
@@ -78,9 +78,7 @@
             appobjects = self[oid] =  []
         else:
             appobjects = self.setdefault(oid, [])
-        # registered() is technically a classmethod but is not declared
-        # as such because we need to compose registered in some cases
-        appobject = obj.registered.im_func(obj, self)
+        appobject = obj.__registered__(self)
         assert not appobject in appobjects, \
                'object %s is already registered' % appobject
         assert callable(appobject.__select__), appobject
--- a/web/views/actions.py	Thu Aug 13 11:49:56 2009 +0200
+++ b/web/views/actions.py	Thu Aug 13 11:54:19 2009 +0200
@@ -158,14 +158,13 @@
     order = 15
 
     @classmethod
-    def registered(cls, vreg):
-        super(ManagePermissionsAction, cls).registered(vreg)
+    def __registered__(cls, vreg):
         if 'require_permission' in vreg.schema:
             cls.__select__ = (one_line_rset() & non_final_entity() &
                               (match_user_groups('managers')
                                | relation_possible('require_permission', 'subject', 'CWPermission',
                                                    action='add')))
-        return super(ManagePermissionsAction, cls).registered(vreg)
+        return super(ManagePermissionsAction, cls).__registered__(vreg)
 
     def url(self):
         return self.rset.get_entity(self.row or 0, self.col or 0).absolute_url(vid='security')