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


Python URI.is_remote_file方法代码示例

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


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

示例1: prepare_for_build

# 需要导入模块: from pisi.uri import URI [as 别名]
# 或者: from pisi.uri.URI import is_remote_file [as 别名]
def prepare_for_build(pspecfile, authInfo=None):

    # FIXME: there is a function named "build" in this module which
    # makes it impossible to use build module directly.
    from build import PisiBuild

    url = URI(pspecfile)
    if url.is_remote_file():
        from sourcefetcher import SourceFetcher
        fs = SourceFetcher(url, authInfo)
        url.uri = fs.fetch_all()

    pb = PisiBuild(url.uri)

    # find out the build dependencies that are not satisfied...
    dep_unsatis = []
    for dep in pb.spec.source.buildDeps:
        if not dependency.installed_satisfies_dep(dep):
            dep_unsatis.append(dep)

    # FIXME: take care of the required buildDeps...
    # For now just report an error!
    if dep_unsatis:
        ctx.ui.error(_("Unsatisfied Build Dependencies:"))
        for dep in dep_unsatis:
            ctx.ui.warning(dep.package)

    # FIXME: Don't exit for now! It's annoying to test on a system that
    # doesn't has all packages made with pisi.
    # Will be enabled on the full-pisi system.
    #        sys.exit(1)

    return pb
开发者ID:Tayyib,项目名称:uludag,代码行数:35,代码来源:api.py

示例2: __init__

# 需要导入模块: from pisi.uri import URI [as 别名]
# 或者: from pisi.uri.URI import is_remote_file [as 别名]
    def __init__(self, specuri, authinfo = None):

        # process args
        if not isinstance(specuri, URI):
            specuri = URI(specuri)
        if authinfo:
            specuri.set_auth_info(authinfo)

        self.authinfo = authinfo

        # read spec file, we'll need it :)
        self.set_spec_file(specuri)

        if specuri.is_remote_file():
            #make local here and fuck up
            self.specdir = self.fetch_files()
        else:
            self.specdir = dirname(self.specuri.get_uri())

        self.sourceArchive = SourceArchive(self.spec, self.pkg_work_dir())

        self.set_environment_vars()

        self.actionLocals = None
        self.actionGlobals = None
        self.srcDir = None
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:28,代码来源:build.py

示例3: __init__

# 需要导入模块: from pisi.uri import URI [as 别名]
# 或者: from pisi.uri.URI import is_remote_file [as 别名]
    def __init__(self, packagefn, mode='r'):
        self.filepath = packagefn
        url = URI(packagefn)

        if url.is_remote_file():
            self.fetch_remote_file(url)

        self.impl = archive.ArchiveZip(self.filepath, 'zip', mode)
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:10,代码来源:package.py

示例4: install_single

# 需要导入模块: from pisi.uri import URI [as 别名]
# 或者: from pisi.uri.URI import is_remote_file [as 别名]
def install_single(pkg, upgrade = False):
    """install a single package from URI or ID"""
    url = URI(pkg)
    # Check if we are dealing with a remote file or a real path of
    # package filename. Otherwise we'll try installing a package from
    # the package repository.
    if url.is_remote_file() or os.path.exists(url.uri):
        install_single_file(pkg, upgrade)
    else:
        install_single_name(pkg, upgrade)
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:12,代码来源:atomicoperations.py

示例5: prepare_for_build

# 需要导入模块: from pisi.uri import URI [as 别名]
# 或者: from pisi.uri.URI import is_remote_file [as 别名]
def prepare_for_build(pspecfile, authInfo=None):

    url = URI(pspecfile)
    if url.is_remote_file():
        from sourcefetcher import SourceFetcher
        fs = SourceFetcher(url, authInfo)
        url.uri = fs.fetch_all()

    import pisi.build
    pb = pisi.build.Builder(url.uri)

    return pb
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:14,代码来源:api.py

示例6: prepare_for_build

# 需要导入模块: from pisi.uri import URI [as 别名]
# 或者: from pisi.uri.URI import is_remote_file [as 别名]
def prepare_for_build(pspecfile, authInfo=None):

    # FIXME: there is a function named "build" in this module which
    # makes it impossible to use build module directly.
    from build import PisiBuild

    url = URI(pspecfile)
    if url.is_remote_file():
        from sourcefetcher import SourceFetcher
        fs = SourceFetcher(url, authInfo)
        url.uri = fs.fetch_all()

    pb = PisiBuild(url.uri)
    return pb
开发者ID:Tayyib,项目名称:uludag,代码行数:16,代码来源:api.py

示例7: read_uri

# 需要导入模块: from pisi.uri import URI [as 别名]
# 或者: from pisi.uri.URI import is_remote_file [as 别名]
    def read_uri(self, filename, repo = None):
        """Read PSPEC file"""

        self.filepath = filename
        url = URI(filename)
        if url.is_remote_file():
            from fetcher import fetch_url
            assert repo
            dest = os.path.join(ctx.config.index_dir(), repo)
            if not os.path.exists(dest):
                os.makedirs(dest)
            fetch_url(url, dest, ctx.ui.Progress)

            self.filepath = os.path.join(dest, url.filename())

        self.read(self.filepath)
开发者ID:Tayyib,项目名称:uludag,代码行数:18,代码来源:index.py

示例8: __init__

# 需要导入模块: from pisi.uri import URI [as 别名]
# 或者: from pisi.uri.URI import is_remote_file [as 别名]
    def __init__(self, packagefn, mode='r'):
        self.filepath = packagefn
        url = URI(packagefn)

        if url.is_remote_file():
            from fetcher import fetch_url
            dest = ctx.config.packages_dir()
            self.filepath = join(dest, url.filename())
            
            # FIXME: exists is not enough, also sha1sum check needed \
            #        when implemented in pisi-index.xml
            if not exists(self.filepath):
                fetch_url(url, dest, ctx.ui.Progress)
            else:
                ctx.ui.info(_('%s [cached]') % url.filename())
                
        self.impl = archive.ArchiveZip(self.filepath, 'zip', mode)
开发者ID:Tayyib,项目名称:uludag,代码行数:19,代码来源:package.py

示例9: read

# 需要导入模块: from pisi.uri import URI [as 别名]
# 或者: from pisi.uri.URI import is_remote_file [as 别名]
    def read(self, filename, repo = None):
        """Read PSPEC file"""

        self.filepath = filename
        url = URI(filename)
        if url.is_remote_file():
            from fetcher import fetch_url

            dest = os.path.join(ctx.config.index_dir(), repo)
            if not os.path.exists(dest):
                os.makedirs(dest)
            fetch_url(url, dest, ctx.ui.Progress)

            self.filepath = os.path.join(dest, url.filename())

        self.readxml(self.filepath)

        # find all binary packages
        packageElts = self.getAllNodes("Package")
        self.packages = [metadata.PackageInfo(p) for p in packageElts]
        
        self.unlink()
开发者ID:Tayyib,项目名称:uludag,代码行数:24,代码来源:index.py


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