1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-09-07 05:38:43 +02:00

Merge branch 'prjresults-watch' of https://github.com/JanZerebecki/osc

Add "--watch" option to "osc prjresults" ("--watch" can only be used
in combination with "--xml").
This commit is contained in:
Marcus Huewe
2018-11-06 16:44:50 +01:00
7 changed files with 205 additions and 3 deletions

View File

@@ -5156,7 +5156,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)')
@@ -5239,6 +5239,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,
@@ -5277,9 +5279,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, \

View File

@@ -5735,7 +5735,7 @@ def get_results(apiurl, project, package, verbose=False, printJoin='', *args, **
return r
def get_package_results(apiurl, project, package, wait=False, *args, **kwargs):
def get_package_results(apiurl, project, package=None, wait=False, *args, **kwargs):
"""generator that returns a the package results as an xml structure"""
xml = ''
waiting_states = ('blocked', 'scheduled', 'dispatching', 'building',