[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools - include.py:1.22

Fred L. Drake, Jr. fred at zope.com
Thu Apr 1 15:58:19 EST 2004


Update of /cvs-repository/Packages/zpkgtools/zpkgtools
In directory cvs.zope.org:/tmp/cvs-serv18833

Modified Files:
	include.py 
Log Message:
allow the CVS loader to be passed in to the constructor, since it may
have been configured to prefer a particular tag


=== Packages/zpkgtools/zpkgtools/include.py 1.21 => 1.22 ===
--- Packages/zpkgtools/zpkgtools/include.py:1.21	Thu Apr  1 15:42:58 2004
+++ Packages/zpkgtools/zpkgtools/include.py	Thu Apr  1 15:58:19 2004
@@ -179,13 +179,15 @@
     the output tree.
 
     """
-    def __init__(self, source):
+    def __init__(self, source, loader=None):
         if not os.path.exists(source):
             raise InclusionError("source directory does not exist: %r"
                                  % source)
         self.source = os.path.abspath(source)
         self.manifests = []
-        self.cvs_loader = None
+        if loader is None:
+            loader = cvsloader.CvsLoader()
+        self.cvs_loader = loader
 
     def createDistributionTree(self, destination, spec=None):
         """Create the output tree according to `spec`.
@@ -336,7 +338,9 @@
                 # some sort of URL
                 self.includeFromUrl(source, destdir)
             else:
-                # local path
+                # local path; perhaps this join should be handled by
+                # the Specification to avoid having to keep
+                # self.source around?
                 self.includeFromLocalTree(os.path.join(self.source, source),
                                           destdir)
         else:
@@ -366,7 +370,5 @@
             inf.close()
 
     def includeFromCvs(self, cvsurl, destination):
-        if self.cvs_loader is None:
-            self.cvs_loader = cvsloader.CvsLoader()
         source = self.cvs_loader.load(cvsurl.getUrl())
         self.includeFromLocalTree(source, destination)




More information about the Zope-CVS mailing list