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


Python MetaData.package方法代码示例

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


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

示例1: info_name

# 需要导入模块: from pisi.metadata import MetaData [as 别名]
# 或者: from pisi.metadata.MetaData import package [as 别名]
def info_name(package_name, installed=False):
    """fetch package information for a package"""
    if ctx.packagedb.has_package(package_name, pisi.itembyrepodb.all):
        if installed:
            package = ctx.packagedb.get_package(package_name, pisi.itembyrepodb.installed)
        else:
            package, repo = ctx.packagedb.get_package_repo(package_name)
            if repo==pisi.itembyrepodb.installed:
                raise Error(_('Package %s not found') % package_name)

        from pisi.metadata import MetaData
        metadata = MetaData()
        metadata.package = package
        #FIXME: get it from sourcedb if available
        metadata.source = None
        #TODO: fetch the files from server if possible (wow, you maniac -- future exa)
        if installed and ctx.installdb.is_installed(package.name):
            try:
                files = ctx.installdb.files(package.name)
            except pisi.Error, e:
                ctx.ui.warning(e)
                files = None
        else:
            files = None
        return metadata, files
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:27,代码来源:api.py

示例2: info_name

# 需要导入模块: from pisi.metadata import MetaData [as 别名]
# 或者: from pisi.metadata.MetaData import package [as 别名]
def info_name(package_name):
    """fetch package information for a package"""
    if packagedb.has_package(package_name):
        package = packagedb.get_package(package_name)
        from pisi.metadata import MetaData
        metadata = MetaData()
        metadata.package = package
        #FIXME: get it from sourcedb
        metadata.source = None
        #TODO: fetch the files from server if possible
        if ctx.installdb.is_installed(package.name):
            files = ctx.installdb.files(package.name)
        else:
            files = None
        return metadata, files
    else:
        raise Error(_('Package %s not found') % package_name)
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:19,代码来源:api.py

示例3: info_name

# 需要导入模块: from pisi.metadata import MetaData [as 别名]
# 或者: from pisi.metadata.MetaData import package [as 别名]
def info_name(package_name, installed=False):
    """Fetch package information for the given package."""
    if installed:
        package = ctx.packagedb.get_package(package_name, pisi.itembyrepodb.installed)
    else:
        package, repo = ctx.packagedb.get_package_repo(package_name, pisi.itembyrepodb.repos)
        repostr = repo

    from pisi.metadata import MetaData
    metadata = MetaData()
    metadata.package = package
    #FIXME: get it from sourcedb if available
    metadata.source = None
    #TODO: fetch the files from server if possible (wow, you maniac -- future exa)
    if installed and ctx.installdb.is_installed(package.name):
        try:
            files = ctx.installdb.files(package.name)
        except pisi.Error, e:
            ctx.ui.warning(e)
            files = None
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:22,代码来源:api.py


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