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


Python pip.vcs方法代碼示例

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


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

示例1: is_url

# 需要導入模塊: import pip [as 別名]
# 或者: from pip import vcs [as 別名]
def is_url(name):
    """Returns true if the name looks like a URL"""
    if ':' not in name:
        return False
    scheme = name.split(':', 1)[0].lower()
    return scheme in ['http', 'https', 'file', 'ftp'] + vcs.all_schemes 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:8,代碼來源:download.py

示例2: _get_used_vcs_backend

# 需要導入模塊: import pip [as 別名]
# 或者: from pip import vcs [as 別名]
def _get_used_vcs_backend(link):
    for backend in vcs.backends:
        if link.scheme in backend.schemes:
            vcs_backend = backend(link.url)
            return vcs_backend 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:7,代碼來源:download.py

示例3: unpack_url

# 需要導入模塊: import pip [as 別名]
# 或者: from pip import vcs [as 別名]
def unpack_url(link, location, download_dir=None,
               only_download=False, session=None, hashes=None):
    """Unpack link.
       If link is a VCS link:
         if only_download, export into download_dir and ignore location
          else unpack into location
       for other types of link:
         - unpack into location
         - if download_dir, copy the file into download_dir
         - if only_download, mark location for deletion

    :param hashes: A Hashes object, one of whose embedded hashes must match,
        or HashMismatch will be raised. If the Hashes is empty, no matches are
        required, and unhashable types of requirements (like VCS ones, which
        would ordinarily raise HashUnsupported) are allowed.
    """
    # non-editable vcs urls
    if is_vcs_url(link):
        unpack_vcs_link(link, location)

    # file urls
    elif is_file_url(link):
        unpack_file_url(link, location, download_dir, hashes=hashes)

    # http urls
    else:
        if session is None:
            session = PipSession()

        unpack_http_url(
            link,
            location,
            download_dir,
            session,
            hashes=hashes
        )
    if only_download:
        write_delete_marker_file(location) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:40,代碼來源:download.py


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