当前位置: 首页>>代码示例>>Python>>正文


Python subversion.Subversion方法代码示例

本文整理汇总了Python中pip.vcs.subversion.Subversion方法的典型用法代码示例。如果您正苦于以下问题:Python subversion.Subversion方法的具体用法?Python subversion.Subversion怎么用?Python subversion.Subversion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pip.vcs.subversion的用法示例。


在下文中一共展示了subversion.Subversion方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: unpack_file

# 需要导入模块: from pip.vcs import subversion [as 别名]
# 或者: from pip.vcs.subversion import Subversion [as 别名]
def unpack_file(filename, location, content_type, link):
    filename = os.path.realpath(filename)
    if (content_type == 'application/zip'
        or filename.endswith('.zip')
        or filename.endswith('.pybundle')
        or filename.endswith('.whl')
        or zipfile.is_zipfile(filename)):
        unzip_file(filename, location, flatten=not filename.endswith(('.pybundle', '.whl')))
    elif (content_type == 'application/x-gzip'
          or tarfile.is_tarfile(filename)
          or splitext(filename)[1].lower() in ('.tar', '.tar.gz', '.tar.bz2', '.tgz', '.tbz')):
        untar_file(filename, location)
    elif (content_type and content_type.startswith('text/html')
          and is_svn_page(file_contents(filename))):
        # We don't really care about this
        from pip.vcs.subversion import Subversion
        Subversion('svn+' + link.url).unpack(location)
    else:
        ## FIXME: handle?
        ## FIXME: magic signatures?
        logger.fatal('Cannot unpack file %s (downloaded from %s, content-type: %s); cannot detect archive format'
                     % (filename, location, content_type))
        raise InstallationError('Cannot determine archive format of %s' % location) 
开发者ID:aliyun,项目名称:oss-ftp,代码行数:25,代码来源:util.py

示例2: is_svn_page

# 需要导入模块: from pip.vcs import subversion [as 别名]
# 或者: from pip.vcs.subversion import Subversion [as 别名]
def is_svn_page(html):
    """
    Returns true if the page appears to be the index page of an svn repository
    """
    return (re.search(r'<title>[^<]*Revision \d+:', html) and
            re.search(r'Powered by (?:<a[^>]*?>)?Subversion', html, re.I)) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:8,代码来源:__init__.py

示例3: unpack_file

# 需要导入模块: from pip.vcs import subversion [as 别名]
# 或者: from pip.vcs.subversion import Subversion [as 别名]
def unpack_file(filename, location, content_type, link):
    filename = os.path.realpath(filename)
    if (content_type == 'application/zip' or
            filename.lower().endswith(ZIP_EXTENSIONS) or
            zipfile.is_zipfile(filename)):
        unzip_file(
            filename,
            location,
            flatten=not filename.endswith('.whl')
        )
    elif (content_type == 'application/x-gzip' or
            tarfile.is_tarfile(filename) or
            filename.lower().endswith(
                TAR_EXTENSIONS + BZ2_EXTENSIONS + XZ_EXTENSIONS)):
        untar_file(filename, location)
    elif (content_type and content_type.startswith('text/html') and
            is_svn_page(file_contents(filename))):
        # We don't really care about this
        from pip.vcs.subversion import Subversion
        Subversion('svn+' + link.url).unpack(location)
    else:
        # FIXME: handle?
        # FIXME: magic signatures?
        logger.critical(
            'Cannot unpack file %s (downloaded from %s, content-type: %s); '
            'cannot detect archive format',
            filename, location, content_type,
        )
        raise InstallationError(
            'Cannot determine archive format of %s' % location
        ) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:33,代码来源:__init__.py

示例4: is_svn_page

# 需要导入模块: from pip.vcs import subversion [as 别名]
# 或者: from pip.vcs.subversion import Subversion [as 别名]
def is_svn_page(html):
    """Returns true if the page appears to be the index page of an svn repository"""
    return (re.search(r'<title>[^<]*Revision \d+:', html)
            and re.search(r'Powered by (?:<a[^>]*?>)?Subversion', html, re.I)) 
开发者ID:aliyun,项目名称:oss-ftp,代码行数:6,代码来源:util.py

示例5: unpack_file

# 需要导入模块: from pip.vcs import subversion [as 别名]
# 或者: from pip.vcs.subversion import Subversion [as 别名]
def unpack_file(filename, location, content_type, link):
    filename = os.path.realpath(filename)
    if (content_type == 'application/zip' or
            filename.lower().endswith(ZIP_EXTENSIONS) or
            zipfile.is_zipfile(filename)):
        unzip_file(
            filename,
            location,
            flatten=not filename.endswith('.whl')
        )
    elif (content_type == 'application/x-gzip' or
            tarfile.is_tarfile(filename) or
            filename.lower().endswith(TAR_EXTENSIONS + BZ2_EXTENSIONS)):
        untar_file(filename, location)
    elif (content_type and content_type.startswith('text/html') and
            is_svn_page(file_contents(filename))):
        # We don't really care about this
        from pip.vcs.subversion import Subversion
        Subversion('svn+' + link.url).unpack(location)
    else:
        # FIXME: handle?
        # FIXME: magic signatures?
        logger.critical(
            'Cannot unpack file %s (downloaded from %s, content-type: %s); '
            'cannot detect archive format',
            filename, location, content_type,
        )
        raise InstallationError(
            'Cannot determine archive format of %s' % location
        ) 
开发者ID:chalasr,项目名称:Flask-P2P,代码行数:32,代码来源:__init__.py


注:本文中的pip.vcs.subversion.Subversion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。