Commit 507ab6cb authored by Andreas Jung's avatar Andreas Jung

- Collector #1593: fixed dumb _get_id() implementation in

        OFS.CopySupport that produced copy_of_copy_of....files
parent 307c6a52
...@@ -46,6 +46,9 @@ Zope Changes ...@@ -46,6 +46,9 @@ Zope Changes
Bugs fixed Bugs fixed
- Collector #1593: fixed dumb _get_id() implementation in
OFS.CopySupport that produced copy_of_copy_of....files
- Collector #1450: files in utilities/ZODBTools are now installed - Collector #1450: files in utilities/ZODBTools are now installed
during the installation process in the 'bin' directory during the installation process in the 'bin' directory
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
$Id$ $Id$
""" """
import sys, Globals, Moniker, tempfile, ExtensionClass import re, sys, Globals, Moniker, tempfile, ExtensionClass
from marshal import loads, dumps from marshal import loads, dumps
from urllib import quote, unquote from urllib import quote, unquote
from zlib import compress, decompress from zlib import compress, decompress
...@@ -113,13 +113,18 @@ class CopyContainer(ExtensionClass.Base): ...@@ -113,13 +113,18 @@ class CopyContainer(ExtensionClass.Base):
return self.manage_main(self, REQUEST) return self.manage_main(self, REQUEST)
return cp return cp
copy_re=re.compile('^copy[0-9]*_of_')
def _get_id(self, id): def _get_id(self, id):
# Allow containers to override the generation of # Allow containers to override the generation of
# object copy id by attempting to call its _get_id # object copy id by attempting to call its _get_id
# method, if it exists. # method, if it exists.
n=0 copy_match=self.copy_re.match(id)
if (len(id) > 8) and (id[8:]=='copy_of_'): if (copy_match) and (copy_match.end() < len(id)):
n=1 n=1
orig_id=self.copy_re.sub('', id)
else:
n=0
orig_id=id orig_id=id
while 1: while 1:
if self._getOb(id, None) is None: if self._getOb(id, None) is None:
......
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