本文整理汇总了Python中osclib.stagingapi.StagingAPI.extract_staging_short方法的典型用法代码示例。如果您正苦于以下问题:Python StagingAPI.extract_staging_short方法的具体用法?Python StagingAPI.extract_staging_short怎么用?Python StagingAPI.extract_staging_short使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osclib.stagingapi.StagingAPI
的用法示例。
在下文中一共展示了StagingAPI.extract_staging_short方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: do_staging
# 需要导入模块: from osclib.stagingapi import StagingAPI [as 别名]
# 或者: from osclib.stagingapi.StagingAPI import extract_staging_short [as 别名]
#.........这里部分代码省略.........
if api.item_exists(api.prj_from_letter(prj)):
cmd.cleanup(api.prj_from_letter(prj))
cmd.accept_other_new()
if opts.project.startswith('openSUSE:'):
cmd.update_factory_version()
if api.item_exists(api.crebuild):
cmd.sync_buildfailures()
else:
print("Not safe to accept: /totest is not yet synced")
elif cmd == 'unselect':
if opts.message:
print('Ignoring requests first')
IgnoreCommand(api).perform(args[1:], opts.message)
UnselectCommand(api).perform(args[1:], opts.cleanup)
elif cmd == 'select':
# Include list of all stagings in short-hand and by full name.
existing_stagings = api.get_staging_projects_short(None)
existing_stagings += api.get_staging_projects()
stagings = []
requests = []
for arg in args[1:]:
# Since requests may be given by either request ID or package
# name and stagings may include multi-letter special stagings
# there is no easy way to distinguish between stagings and
# requests in arguments. Therefore, check if argument is in the
# list of short-hand and full project name stagings, otherwise
# consider it a request. This also allows for special stagings
# with the same name as package, but the staging will be assumed
# first time around. The current practice seems to be to start a
# special staging with a capital letter which makes them unique.
# lastly adi stagings are consistently prefix with adi: which
# also makes it consistent to distinguish them from request IDs.
if arg in existing_stagings and arg not in stagings:
stagings.append(api.extract_staging_short(arg))
elif arg not in requests:
requests.append(arg)
if len(stagings) != 1 or len(requests) == 0 or opts.filter_by or opts.group_by:
if opts.move or opts.filter_from:
print('--move and --filter-from must be used with explicit staging and request list')
return
open_requests = api.get_open_requests({'withhistory': 1}, include_nonfree=False)
if len(open_requests) == 0:
print('No open requests to consider')
return
splitter = RequestSplitter(api, open_requests, in_ring=True)
considerable = splitter.stagings_load(stagings)
if considerable == 0:
print('No considerable stagings on which to act')
return
if opts.merge:
splitter.merge()
if opts.try_strategies:
splitter.strategies_try()
if len(requests) > 0:
splitter.strategy_do('requests', requests=requests)
if opts.strategy:
splitter.strategy_do(opts.strategy)
elif opts.filter_by or opts.group_by:
kwargs = {}
if opts.filter_by:
kwargs['filters'] = opts.filter_by