コード例 #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)
コード例 #2
0
ファイル: index.py プロジェクト: Black-Thunder01/PythonAPI
 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)
コード例 #3
0
 def export(self, location):
     """Export the svn repository at the url to the destination location"""
     url, rev = self.get_url_rev()
     rev_options = get_rev_options(self, url, rev)
     url = remove_auth_from_url(url)
     logger.info('Exporting svn repository %s to %s', url, location)
     with indent_log():
         if os.path.exists(location):
             # Subversion doesn't like to check out over an existing
             # directory --force fixes this, but was only added in svn 1.5
             rmtree(location)
         cmd_args = ['export'] + rev_options.to_args() + [url, location]
         self.run_command(cmd_args, show_stdout=False)
コード例 #4
0
 def obtain(self, dest):
     url, rev = self.get_url_rev()
     rev_options = get_rev_options(self, url, rev)
     url = remove_auth_from_url(url)
     if self.check_destination(dest, url, rev_options):
         rev_display = rev_options.to_display()
         logger.info(
             'Checking out %s%s to %s',
             url,
             rev_display,
             display_path(dest),
         )
         cmd_args = ['checkout', '-q'] + rev_options.to_args() + [url, dest]
         self.run_command(cmd_args)
コード例 #5
0
    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
コード例 #6
0
ファイル: test_utils.py プロジェクト: murrayrush/pip
def test_remove_auth_from_url(auth_url, expected_url):
    url = remove_auth_from_url(auth_url)
    assert url == expected_url
コード例 #7
0
ファイル: subversion.py プロジェクト: zx996/-cs1531
    def get_url_rev_args(self, url):
        extra_args = get_rev_options_args(url)
        url = remove_auth_from_url(url)

        return url, extra_args
コード例 #8
0
        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
<<<<<<< HEAD
        return None

    def _get_new_credentials(self, original_url, allow_netrc=True,
                             allow_keyring=True):
        # type: (str, bool, bool) -> AuthInfo
=======

    def _get_new_credentials(self, original_url, allow_netrc=True,
                             allow_keyring=True):
>>>>>>> b66a76afa15ab74019740676a52a071b85ed8f71
        """Find and return credentials for the specified URL."""
        # Split the credentials and netloc from the url.
コード例 #9
0
ファイル: subversion.py プロジェクト: vtitor/pip
    def get_url_rev_args(self, url):
        extra_args = get_rev_options_args(url)
        url = remove_auth_from_url(url)

        return url, extra_args
コード例 #10
0
ファイル: test_utils.py プロジェクト: jonparrott/pip
def test_remove_auth_from_url(auth_url, expected_url):
    url = remove_auth_from_url(auth_url)
    assert url == expected_url
コード例 #11
0
ファイル: subversion.py プロジェクト: javabrett/pip
 def obtain(self, dest):
     url, rev = self.get_url_rev()
     rev_options = get_rev_options(self, url, rev)
     url = remove_auth_from_url(url)
     if self.check_destination(dest, url, rev_options):
         self.fetch_new(dest, url, rev_options)
コード例 #12
0
ファイル: test_utils.py プロジェクト: pradyunsg/pip
def test_remove_auth_from_url(auth_url: str, expected_url: str) -> None:
    url = remove_auth_from_url(auth_url)
    assert url == expected_url