本文整理汇总了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
示例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)
示例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