[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools - locationmap.py:1.4

Fred L. Drake, Jr. fred at zope.com
Wed Mar 10 15:43:30 EST 2004


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

Modified Files:
	locationmap.py 
Log Message:
fromPathOrUrl():  if the path specifies a cvs: URL, use
cvsloader.open() instead of urllib2.urlopen()


=== Packages/zpkgtools/zpkgtools/locationmap.py 1.3 => 1.4 ===
--- Packages/zpkgtools/zpkgtools/locationmap.py:1.3	Wed Mar 10 02:38:07 2004
+++ Packages/zpkgtools/zpkgtools/locationmap.py	Wed Mar 10 15:43:30 2004
@@ -120,7 +120,12 @@
             base = cvsurl.getUrl()
         f = open(path, "rU")
     else:
-        f = urllib2.urlopen(path)
+        try:
+            cvsloader.parse(path)
+        except ValueError:
+            f = urllib2.urlopen(path)
+        else:
+            f = cvsloader.open(path, "rU")
     try:
         return load(f, base, mapping)
     finally:




More information about the Zope-CVS mailing list