[Zope3-checkins] CVS: Zope3/src/zope/fssync - fssync.py:1.45
Fred L. Drake, Jr.
fred at zope.com
Fri Aug 29 09:47:37 EDT 2003
Update of /cvs-repository/Zope3/src/zope/fssync
In directory cvs.zope.org:/tmp/cvs-serv3703
Modified Files:
fssync.py
Log Message:
add(): refactor into the high-level add() and a more fundamental
basicadd() that can be used as a building block for other
functionality (such as a copy operation)
=== Zope3/src/zope/fssync/fssync.py 1.44 => 1.45 ===
--- Zope3/src/zope/fssync/fssync.py:1.44 Wed Aug 27 15:36:21 2003
+++ Zope3/src/zope/fssync/fssync.py Fri Aug 29 08:47:36 2003
@@ -550,11 +550,7 @@
self.diff(t, mode, diffopts, need_original)
def add(self, path, type=None, factory=None):
- if not exists(path):
- raise Error("nothing known about '%s'", path)
- entry = self.metadata.getentry(path)
- if entry:
- raise Error("path '%s' is already registered", path)
+ entry = self.basicadd(path, type, factory)
head, tail = fsutil.split(path)
pentry = self.metadata.getentry(head)
if not pentry:
@@ -566,11 +562,6 @@
zpath += "/"
zpath += tail
entry["path"] = zpath
- entry["flag"] = "added"
- if type:
- entry["type"] = type
- if factory:
- entry["factory"] = factory
self.metadata.flush()
if isdir(path):
# Force Entries.xml to exist, even if it wouldn't normally
@@ -583,6 +574,19 @@
print "A", join(path, "")
else:
print "A", path
+
+ def basicadd(self, path, type=None, factory=None):
+ if not exists(path):
+ raise Error("nothing known about '%s'", path)
+ entry = self.metadata.getentry(path)
+ if entry:
+ raise Error("path '%s' is already registered", path)
+ entry["flag"] = "added"
+ if type:
+ entry["type"] = type
+ if factory:
+ entry["factory"] = factory
+ return entry
def mkdir(self, path):
dir, name = split(path)
More information about the Zope3-Checkins
mailing list