1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 09:16:16 +02:00

-new command rprjresults, to show remote project results

-new command rresults, to show remote package results
This commit is contained in:
Tom Patzig 2008-05-16 12:25:50 +00:00
parent e69486bdc8
commit abb97eb595

View File

@ -1296,6 +1296,27 @@ class Osc(cmdln.Cmdln):
for pac in pacs:
print '\n'.join(get_results(pac.apiurl, pac.prjname, pac.name))
def do_rresults(self, subcmd, opts, *args):
"""${cmd_name}: Shows the build results of a remote package
Examples:
osc rresults <remote project name> <remote package name>
${cmd_usage}
${cmd_option_list}
"""
if args and len(args) > 2:
print >>sys.stderr, 'getting remote results for more than one package is not supported'
return 2
project = args[0]
pac = args[1]
apiurl = conf.config['apiurl']
print '\n'.join(get_results(apiurl, project, pac))
@cmdln.option('-q', '--hide-legend', action='store_true',
help='hide the legend')
@ -1335,6 +1356,42 @@ class Osc(cmdln.Cmdln):
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))
@cmdln.option('-q', '--hide-legend', action='store_true',
help='hide the legend')
@cmdln.option('-c', '--csv', action='store_true',
help='csv output')
@cmdln.option('-s', '--status-filter', metavar='STATUS',
help='show only packages with buildstatus STATUS (see legend)')
@cmdln.option('-n', '--name-filter', metavar='EXPR',
help='show only packages whos name matches EXPR')
def do_rprjresults(self, subcmd, opts, *args):
"""${cmd_name}: Shows project-wide build results of remote Projects
Examples:
osc rprjresults <remote project name>
${cmd_usage}
${cmd_option_list}
"""
if args and len(args) > 1:
print >>sys.stderr, 'getting results for more than one project is not supported'
return 2
if args:
wd = args[0]
else:
print >>sys.stderr, 'specify project name of the remote Project'
return 2
project = wd
apiurl = conf.config['apiurl']
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))
@cmdln.alias('bl')
def do_buildlog(self, subcmd, opts, platform, arch):