當前位置: 首頁>>代碼示例>>Python>>正文


Python download.path_to_url方法代碼示例

本文整理匯總了Python中pip._internal.download.path_to_url方法的典型用法代碼示例。如果您正苦於以下問題:Python download.path_to_url方法的具體用法?Python download.path_to_url怎麽用?Python download.path_to_url使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pip._internal.download的用法示例。


在下文中一共展示了download.path_to_url方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from pip._internal import download [as 別名]
# 或者: from pip._internal.download import path_to_url [as 別名]
def __init__(self, url, comes_from=None, requires_python=None):
        """
        Object representing a parsed link from https://pypi.org/simple/*

        url:
            url of the resource pointed to (href of the link)
        comes_from:
            instance of HTMLPage where the link was found, or string.
        requires_python:
            String containing the `Requires-Python` metadata field, specified
            in PEP 345. This may be specified by a data-requires-python
            attribute in the HTML link tag, as described in PEP 503.
        """

        # url can be a UNC windows share
        if url.startswith('\\\\'):
            url = path_to_url(url)

        self.url = url
        self.comes_from = comes_from
        self.requires_python = requires_python if requires_python else None 
開發者ID:HaoZhang95,項目名稱:Python24,代碼行數:23,代碼來源:index.py

示例2: __init__

# 需要導入模塊: from pip._internal import download [as 別名]
# 或者: from pip._internal.download import path_to_url [as 別名]
def __init__(self, url, comes_from=None, requires_python=None):
        """
        Object representing a parsed link from https://pypi.python.org/simple/*

        url:
            url of the resource pointed to (href of the link)
        comes_from:
            instance of HTMLPage where the link was found, or string.
        requires_python:
            String containing the `Requires-Python` metadata field, specified
            in PEP 345. This may be specified by a data-requires-python
            attribute in the HTML link tag, as described in PEP 503.
        """

        # url can be a UNC windows share
        if url.startswith('\\\\'):
            url = path_to_url(url)

        self.url = url
        self.comes_from = comes_from
        self.requires_python = requires_python if requires_python else None 
開發者ID:wangzhenjjcn,項目名稱:FuYiSpider,代碼行數:23,代碼來源:index.py

示例3: __init__

# 需要導入模塊: from pip._internal import download [as 別名]
# 或者: from pip._internal.download import path_to_url [as 別名]
def __init__(self, url, comes_from=None, requires_python=None):
        # type: (str, Optional[Union[str, HTMLPage]], Optional[str]) -> None
        """
        url:
            url of the resource pointed to (href of the link)
        comes_from:
            instance of HTMLPage where the link was found, or string.
        requires_python:
            String containing the `Requires-Python` metadata field, specified
            in PEP 345. This may be specified by a data-requires-python
            attribute in the HTML link tag, as described in PEP 503.
        """

        # url can be a UNC windows share
        if url.startswith('\\\\'):
            url = path_to_url(url)

        self.url = url
        self.comes_from = comes_from
        self.requires_python = requires_python if requires_python else None

        super(Link, self).__init__(
            key=(self.url),
            defining_class=Link
        ) 
開發者ID:PacktPublishing,項目名稱:Mastering-Elasticsearch-7.0,代碼行數:27,代碼來源:link.py

示例4: __init__

# 需要導入模塊: from pip._internal import download [as 別名]
# 或者: from pip._internal.download import path_to_url [as 別名]
def __init__(self, url, comes_from=None, requires_python=None):
        """
        url:
            url of the resource pointed to (href of the link)
        comes_from:
            instance of HTMLPage where the link was found, or string.
        requires_python:
            String containing the `Requires-Python` metadata field, specified
            in PEP 345. This may be specified by a data-requires-python
            attribute in the HTML link tag, as described in PEP 503.
        """

        # url can be a UNC windows share
        if url.startswith('\\\\'):
            url = path_to_url(url)

        self.url = url
        self.comes_from = comes_from
        self.requires_python = requires_python if requires_python else None

        super(Link, self).__init__(
            key=(self.url),
            defining_class=Link
        ) 
開發者ID:luckystarufo,項目名稱:pySINDy,代碼行數:26,代碼來源:link.py

示例5: get_url

# 需要導入模塊: from pip._internal import download [as 別名]
# 或者: from pip._internal.download import path_to_url [as 別名]
def get_url(self, location):
        url = self.run_command(
            ['showconfig', 'paths.default'],
            show_stdout=False, cwd=location).strip()
        if self._is_local_repository(url):
            url = path_to_url(url)
        return url.strip() 
開發者ID:HaoZhang95,項目名稱:Python24,代碼行數:9,代碼來源:mercurial.py

示例6: get_url

# 需要導入模塊: from pip._internal import download [as 別名]
# 或者: from pip._internal.download import path_to_url [as 別名]
def get_url(self, location):
        urls = self.run_command(['info'], show_stdout=False, cwd=location)
        for line in urls.splitlines():
            line = line.strip()
            for x in ('checkout of branch: ',
                      'parent branch: '):
                if line.startswith(x):
                    repo = line.split(x)[1]
                    if self._is_local_repository(repo):
                        return path_to_url(repo)
                    return repo
        return None 
開發者ID:HaoZhang95,項目名稱:Python24,代碼行數:14,代碼來源:bazaar.py

示例7: _link_for_candidate

# 需要導入模塊: from pip._internal import download [as 別名]
# 或者: from pip._internal.download import path_to_url [as 別名]
def _link_for_candidate(self, link, candidate):
        root = self.get_path_for_link(link)
        path = os.path.join(root, candidate)

        return index.Link(path_to_url(path)) 
開發者ID:HaoZhang95,項目名稱:Python24,代碼行數:7,代碼來源:cache.py

示例8: get_remote_url

# 需要導入模塊: from pip._internal import download [as 別名]
# 或者: from pip._internal.download import path_to_url [as 別名]
def get_remote_url(cls, location):
        url = cls.run_command(
            ['showconfig', 'paths.default'],
            show_stdout=False, cwd=location).strip()
        if cls._is_local_repository(url):
            url = path_to_url(url)
        return url.strip() 
開發者ID:PacktPublishing,項目名稱:Mastering-Elasticsearch-7.0,代碼行數:9,代碼來源:mercurial.py

示例9: get_remote_url

# 需要導入模塊: from pip._internal import download [as 別名]
# 或者: from pip._internal.download import path_to_url [as 別名]
def get_remote_url(cls, location):
        urls = cls.run_command(['info'], show_stdout=False, cwd=location)
        for line in urls.splitlines():
            line = line.strip()
            for x in ('checkout of branch: ',
                      'parent branch: '):
                if line.startswith(x):
                    repo = line.split(x)[1]
                    if cls._is_local_repository(repo):
                        return path_to_url(repo)
                    return repo
        return None 
開發者ID:PacktPublishing,項目名稱:Mastering-Elasticsearch-7.0,代碼行數:14,代碼來源:bazaar.py

示例10: _link_for_candidate

# 需要導入模塊: from pip._internal import download [as 別名]
# 或者: from pip._internal.download import path_to_url [as 別名]
def _link_for_candidate(self, link, candidate):
        # type: (Link, str) -> Link
        root = self.get_path_for_link(link)
        path = os.path.join(root, candidate)

        return Link(path_to_url(path)) 
開發者ID:PacktPublishing,項目名稱:Mastering-Elasticsearch-7.0,代碼行數:8,代碼來源:cache.py


注:本文中的pip._internal.download.path_to_url方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。