Anonymous avatar Anonymous committed 4ba7ace

Backport support for file:// directory URLs in --find-links to 0.6

Comments (0)

Files changed (1)


     def process_filename(self, fn, nested=False):
         # process filenames or directories
         if not os.path.exists(fn):
-            self.warn("Not found: %s", url)
+            self.warn("Not found: %s", fn)
         if os.path.isdir(fn) and not nested:
     def find_packages(self, requirement):
         self.scan_url(self.index_url + requirement.unsafe_name+'/')
         if not self.package_pages.get(requirement.key):
             # Fall back to safe version of the name
             self.scan_url(self.index_url + requirement.project_name+'/')
     def gen_setup(self, filename, fragment, tmpdir):
-        match = EGG_FRAGMENT.match(fragment); #import pdb; pdb.set_trace()
+        match = EGG_FRAGMENT.match(fragment)
         dists = match and [d for d in
             interpret_distro_name(filename,, None) if d.version
         ] or []
                 "Can't process plain .py files without an '#egg=name-version'"
                 " suffix to enable automatic setup script generation."
     dl_blocksize = 8192
     def _download_to(self, url, filename):
         self.url_ok(url,True)   # raises error if not allowed
     def _download_url(self, scheme, url, tmpdir):
         # Determine download filename
         name = filter(None,urlparse.urlparse(url)[2].split('/'))
         if scheme=='svn' or scheme.startswith('svn+'):
             return self._download_svn(url, filename)
+        elif scheme=='file':
+            return urllib2.url2pathname(urlparse.urlparse(url)[2])
             headers = self.retry_sf_download(url, filename)
             if 'html' in headers['content-type'].lower():
     def scan_url(self, url):
         self.process_url(url, True)
     def _download_html(self, url, headers, filename, tmpdir):
         file = open(filename)
         for line in file:
+# this line is a kludge to keep the trailing blank lines for pje's editor
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.