1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-10-05 08:59:19 +02:00

Add --watch for osc prjresults --xml

Like: osc results --watch
This commit is contained in:
2018-11-05 22:57:14 +01:00
committed by lethliel
parent 82a222fcb2
commit 429df0dc70
3 changed files with 26 additions and 3 deletions

View File

@@ -5162,7 +5162,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
help='Disable results for all direct affect packages inside of the project')
@cmdln.option('-M', '--multibuild-package', action='append', default=[],
help='Only show results for the specified multibuild package')
@cmdln.option('-w', '--watch', action='store_true', default=False,
@cmdln.option('-w', '--watch', action='store_true',
help='watch the results until all finished building')
@cmdln.option('', '--xml', action='store_true', default=False,
help='generate output in XML (former results_meta)')
@@ -5245,6 +5245,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
# as well when adding a new option!
@cmdln.option('-q', '--hide-legend', action='store_true',
help='hide the legend')
@cmdln.option('-w', '--watch', action='store_true',
help='watch the results until all finished building, only supported with --xml')
@cmdln.option('-c', '--csv', action='store_true',
help='csv output')
@cmdln.option('', '--xml', action='store_true', default=False,
@@ -5283,9 +5285,20 @@ Please submit there instead, or use --nodevelproject to force direct submission.
project = store_read_project(wd)
if opts.xml:
print(''.join(show_prj_results_meta(apiurl, project, opts.repo, opts.arch)))
kwargs = {}
if opts.repo:
kwargs['repository'] = opts.repo
if opts.arch:
kwargs['arch'] = opts.arch
kwargs['wait'] = opts.watch
for results in get_package_results(apiurl, project, **kwargs):
print(results)
return
if opts.watch:
print('Please implement support for osc prjresults --watch without --xml.')
return 2
print('\n'.join(get_prj_results(apiurl, project, hide_legend=opts.hide_legend, \
csv=opts.csv, status_filter=opts.status_filter, \
name_filter=opts.name_filter, repo=opts.repo, \