1. Tarek Ziadé
  2. distribute


phillip.eby  committed 4ba7ace

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

  • Participants
  • Parent commits 4bf55a6
  • Branches setuptools-0.6

Comments (0)

Files changed (1)

File setuptools/package_index.py

View file
  • Ignore whitespace
     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, match.group(1), 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