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


Python yum.YumBase方法代码示例

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


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

示例1: YumSingleton

# 需要导入模块: import yum [as 别名]
# 或者: from yum import YumBase [as 别名]
def YumSingleton():
    from StringIO import StringIO
    new_out = StringIO()
    sav_out = (sys.stdout, sys.stderr)      # save old IO
    [ x.flush() for x in sav_out ]          # flush output
    sys.stdout = sys.stderr = new_out
    ex = None
    try:
        yb = YumBase()
        yb.conf
        return yb
    except Exception as x:
        ex = x                              # save exception
    finally:
        new_out.flush()                     # grab the output
        (sys.stdout, sys.stderr) = sav_out  # restore it
    # if we got here, then we had an error
    sys.stderr.write(str(new_out))
    raise ex if ex else Exception('Error creating yum.YumBase()') 
开发者ID:RedHatSatellite,项目名称:satellite-demo,代码行数:21,代码来源:subscription_repos.py

示例2: __init__

# 需要导入模块: import yum [as 别名]
# 或者: from yum import YumBase [as 别名]
def __init__(self, repolist=[], yumbase=None, mdconf=None, mdbase_class=None ):
        self.repolist = repolist
        self.outputdir = '%s/merged_repo' % os.getcwd()
        self.exclude_tuples = []
        self.sort_func = self._sort_func # callback function to magically sort pkgs
        if not mdconf:
            self.mdconf = createrepo.MetaDataConfig()
        else:
            self.mdconf = mdconf
        if not mdbase_class:
            self.mdbase_class = createrepo.MetaDataGenerator
        else:
            self.mdbase_class = mdbase_class
        if not yumbase:
            self.yumbase = yum.YumBase()
        else:
            self.yumbase = yumbase
        self.yumbase.conf.cachedir = getCacheDir()
        self.yumbase.conf.cache = 0
        # default to all arches
        self.archlist = unique(rpmUtils.arch.arches.keys() + rpmUtils.arch.arches.values())
        self.groups = True
        self.updateinfo = True 
开发者ID:crohr,项目名称:rpm-s3,代码行数:25,代码来源:merge.py

示例3: __init__

# 需要导入模块: import yum [as 别名]
# 或者: from yum import YumBase [as 别名]
def __init__(self,changelog_parser,executor,repos_to_exclude=[],repos_to_include=[]):
        self.changelog_parser = changelog_parser
        self.yb = yum.YumBase()
        self.yb.setCacheDir()
        self.executor = executor
        self.repos_to_exclude = repos_to_exclude
        self.repos_to_include = repos_to_include
        for repo in repos_to_exclude:
            self.yb.repos.disableRepo(repo)
        for repo in repos_to_include:
            self.yb.repos.enableRepo(repo) 
开发者ID:wied03,项目名称:centos-package-cron,代码行数:13,代码来源:package_fetcher.py

示例4: __init__

# 需要导入模块: import yum [as 别名]
# 或者: from yum import YumBase [as 别名]
def __init__(self):
        """
        Instantiate the YumUpdates class and creates
        yum.YumBase class's object
        """
        self.yum_obj = yum.YumBase() 
开发者ID:CentOS,项目名称:container-pipeline-service,代码行数:8,代码来源:yumupdates.py


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