[ZCM] [ZC] 1377/ 3 Comment "method parameter not used in OFS.ObjectManager.py"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Wed Jun 16 09:55:04 EDT 2004


Issue #1377 Update (Comment) "method parameter not used in OFS.ObjectManager.py"
 Status Pending, Zope/bug medium
To followup, visit:
  http://collector.zope.org/Zope/1377

==============================================================
= Comment - Entry #3 by tseaver on Jun 16, 2004 9:54 am

It used to be used to allow suppression of the "delete protocol":

$ cvs annotate -D 1999/06/01 lib/python/OFS/ObjectManager.py
...
1.45         (brian    14-Aug-98): 
1.71         (brian    05-May-99):     def _delObject(self, id, dp=1):
1.45         (brian    14-Aug-98):         if id=='acl_users':
1.45         (brian    14-Aug-98):             # Yikes - acl_users is referred to by two names and
1.63         (brian    08-Apr-99):             # must be treated as a special case! Only get rid of
1.63         (brian    08-Apr-99):             # __allow_groups__ if it is an instance attribute, to
1.63         (brian    08-Apr-99):             # avoid deleting the class-default __allow_groups__
1.63         (brian    08-Apr-99):             # in the top-level application object which is needed
1.63         (brian    08-Apr-99):             # to allow people to replace the top-level userfolder.
1.63         (brian    08-Apr-99):             if hasattr(self, '__allow_groups__') and \
1.63         (brian    08-Apr-99):                self.__dict__.has_key('__allow_groups__'):
1.63         (brian    08-Apr-99):                 delattr(self, '__allow_groups__')
1.71         (brian    05-May-99):         # Deletion protocol - when an object is being deleted,
1.71         (brian    05-May-99):         # attempt to call it's _on_delete_object method if
1.71         (brian    05-May-99):         # if has one. The dp flag allows allows callers to
1.71         (brian    05-May-99):         # avoid having the delete protocol triggered (for
1.71         (brian    05-May-99):         # instance when an object is cut and pasted).
1.71         (brian    05-May-99):         if dp:
1.71         (brian    05-May-99):             ob=self._getOb(id)
1.71         (brian    05-May-99):             if hasattr(ob, '_on_delete_object') and \
1.71         (brian    05-May-99):                callable(ob._on_delete_object):
1.71         (brian    05-May-99):                 ob._on_delete_object()
1.71         (brian    05-May-99):             del ob
1.10         (brian    18-Sep-97):         self._objects=tuple(filter(lambda i,n=id: i['id']!=n, self._objects))
1.54         (jim      22-Mar-99):         self._delOb(id)

________________________________________
= Comment - Entry #2 by ajung on Jun 16, 2004 12:52 am

no idea what this 'dp' parameter is used for :-)
looks like a culprit to me.
________________________________________
= Request - Entry #1 by vds on Jun 15, 2004 7:12 am

>From OFS.ObjectManager. py
the "dp" parameter is not use in the method !

    def _delObject(self, id, dp=1):
        object=self._getOb(id)
        try:
            object.manage_beforeDelete(object, self)
        except BeforeDeleteException, ob:
            raise
        except ConflictError:
            raise
        except:
            LOG('Zope',ERROR,'manage_beforeDelete() threw',
                error=sys.exc_info())
            pass
        self._objects=tuple(filter(lambda i,n=id: i['id']!=n, self._objects))
        self._delOb(id)

        # Indicate to the object that it has been deleted. This is
        # necessary for object DB mount points. Note that we have to
        # tolerate failure here because the object being deleted could
        # be a Broken object, and it is not possible to set attributes
        # on Broken objects.
        try:    object._v__object_deleted__ = 1
        except: pass

==============================================================




More information about the Zope-Collector-Monitor mailing list