[Zope3-checkins] CVS: Zope3/src/zope/fssync - fsmerger.py:1.19

Fred L. Drake, Jr. fred at zope.com
Thu Sep 4 11:59:32 EDT 2003


Update of /cvs-repository/Zope3/src/zope/fssync
In directory cvs.zope.org:/tmp/cvs-serv9803

Modified Files:
	fsmerger.py 
Log Message:
- avoid detailed knowledge of how the names of the special directories
  are constructed; that's what the "zope.fssync.fsutil" module is for
- add some comments


=== Zope3/src/zope/fssync/fsmerger.py 1.18 => 1.19 ===
--- Zope3/src/zope/fssync/fsmerger.py:1.18	Thu Sep  4 10:29:29 2003
+++ Zope3/src/zope/fssync/fsmerger.py	Thu Sep  4 10:59:32 2003
@@ -19,7 +19,7 @@
 import os
 import shutil
 
-from os.path import basename, exists, isfile, isdir, join
+from os.path import basename, dirname, exists, isfile, isdir, join
 from os.path import realpath, normcase, normpath
 
 from zope.xmlpickle import dumps
@@ -78,14 +78,15 @@
 
     def remove_special(self, local, what):
         """Helper to remove an Original, Extra or Annotations file/tree."""
-        head, tail = fsutil.split(local)
-        dir = join(head, "@@Zope", what)
-        target = join(dir, tail)
+        target = fsutil.getspecial(local, what)
+        dir = dirname(target)
         if exists(target):
             if isdir(target):
                 shutil.rmtree(target)
             else:
+                # XXX when should this ever happen?
                 os.remove(target)
+        # remove the specials directory if it's empty
         if isdir(dir):
             try:
                 os.rmdir(dir)




More information about the Zope3-Checkins mailing list