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

Fred L. Drake, Jr. fred at zope.com
Thu Mar 18 17:33:11 EST 2004


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

Modified Files:
	locationmap.py 
Log Message:
make locationmap.fromPathOrUrl() do the right thing for non-"cvs:" URLs,
and make the test use that instead of the lower-level interface


=== Packages/zpkgtools/zpkgtools/locationmap.py 1.6 => 1.7 ===
--- Packages/zpkgtools/zpkgtools/locationmap.py:1.6	Thu Mar 18 16:03:36 2004
+++ Packages/zpkgtools/zpkgtools/locationmap.py	Thu Mar 18 17:32:40 2004
@@ -137,6 +137,12 @@
             cvsurl = cvsloader.parse(path)
         except ValueError:
             f = urllib2.urlopen(path)
+            parts = list(urlparse.urlparse(path))
+            if parts[2]:
+                parts[2] = posixpath.join(posixpath.dirname(parts[2]), "")
+                base = urlparse.urlunparse(parts)
+            else:
+                base = path
         else:
             f = cvsloader.open(path, "rU")
             cvsurl.path = posixpath.dirname(cvsurl.path)




More information about the Zope-CVS mailing list