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

Guido van Rossum guido@python.org
Thu, 15 May 2003 18:22:24 -0400


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

Modified Files:
	fssync.py 
Log Message:
Support for adding a commit note (default 'fssync').

Changed multiple() to support passing arbitrary extra arguments.


=== Zope3/src/zope/fssync/fssync.py 1.22 => 1.23 ===
--- Zope3/src/zope/fssync/fssync.py:1.22	Thu May 15 15:48:02 2003
+++ Zope3/src/zope/fssync/fssync.py	Thu May 15 18:22:24 2003
@@ -282,21 +282,21 @@
             fp.close()
         self.network.saverooturl(target)
 
-    def multiple(self, args, method):
+    def multiple(self, args, method, *more):
         if not args:
             args = [os.curdir]
         for target in args:
             if self.metadata.getentry(target):
-                method(target)
+                method(target, *more)
             else:
                 names = self.metadata.getnames(target)
                 if not names:
                     method(target) # Will raise an exception
                 else:
                     for name in names:
-                        method(join(target, name))
+                        method(join(target, name), *more)
 
-    def commit(self, target):
+    def commit(self, target, note="fssync"):
         entry = self.metadata.getentry(target)
         if not entry:
             raise Error("nothing known about", target)
@@ -312,10 +312,9 @@
             if sts:
                 raise Error("zip command failed")
             infp = open(zipfile, "rb")
+            view = "@@fromFS.zip?note=%s" % urllib.quote(note)
             try:
-                outfp, headers = self.network.httpreq(path,
-                                                      "@@fromFS.zip",
-                                                      infp)
+                outfp, headers = self.network.httpreq(path, view, infp)
             finally:
                 infp.close()
         finally: