[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools - loader.py:1.2
Fred L. Drake, Jr.
fred at zope.com
Tue Apr 20 15:19:46 EDT 2004
Update of /cvs-repository/Packages/zpkgtools/zpkgtools
In directory cvs.zope.org:/tmp/cvs-serv29467
Modified Files:
loader.py
Log Message:
- handle Windows paths with drive letters
- make it possible to support URL schemes with a "+" in the name
(svn+ssh:)
- add a stub implementation for a method .load() calls
=== Packages/zpkgtools/zpkgtools/loader.py 1.1 => 1.2 ===
--- Packages/zpkgtools/zpkgtools/loader.py:1.1 Mon Apr 19 23:37:23 2004
+++ Packages/zpkgtools/zpkgtools/loader.py Tue Apr 20 15:19:45 2004
@@ -59,15 +59,20 @@
os.unlink(path)
def load(self, url):
- if ":" in url:
+ if ":" in url and url.find(":") != 1:
type, rest = urllib.splittype(url)
- methodname = "load_" + type
+ # the replace() is to support svn+ssh: URLs
+ methodname = "load_" + type.replace("+", "_")
method = getattr(self, methodname, None)
if method is None:
method = self.unknown_load
else:
method = self.file_load
return method(url)
+
+ def file_load(self, path):
+ """Load using a local path."""
+ raise NotImplementedError("is this ever used?")
def load_file(self, url):
parts = urlparse.urlsplit(url)
More information about the Zope-CVS
mailing list