Exemple #1
0
 def get_formatted_locations(self):
     lines = []
     if self.index_urls and self.index_urls != [PyPI.simple_url]:
         lines.append("Looking in indexes: {}".format(", ".join(
             remove_auth_from_url(url) for url in self.index_urls)))
     if self.find_links:
         lines.append("Looking in links: {}".format(", ".join(
             self.find_links)))
     return "\n".join(lines)
    def _get_index_url(self, url):
        """Return the original index URL matching the requested URL.

        Cached or dynamically generated credentials may work against
        the original index URL rather than just the netloc.

        The provided url should have had its username and password
        removed already. If the original index url had credentials then
        they will be included in the return value.

        Returns None if no matching index was found, or if --no-index
        was specified by the user.
        """
        if not url or not self.index_urls:
            return None

        for u in self.index_urls:
            prefix = remove_auth_from_url(u).rstrip("/") + "/"
            if url.startswith(prefix):
                return u
    def get_url_rev_args(self, url):
        extra_args = get_rev_options_args(url)
        url = remove_auth_from_url(url)

        return url, extra_args