Mailinglist Archive: opensuse-buildservice (250 mails)

< Previous Next >
[opensuse-buildservice] PATCH: add the flag --project to osc prjresults
  • From: Michael Wolf <maw@xxxxxxxxxx>
  • Date: Mon, 18 Aug 2008 18:40:21 -0500
  • Message-id: <1219102821.12701.36.camel@xxxxxxxxxxx>
Yo

This patch adds the flag --project to osc prjresults, overriding other
mechanisms of figuring out which project to look at.

One thing it doesn't really cover is:

osc prjresults --project=Editors:Emacs ~/builds/Editors:Vi

That'll get the results from Editors:Emacs. However, since it's an
arguably nonsensical command line, maybe do_prjresults should bail
instead. But I think my patch is right as is anyway. Thoughts?

The patch also includes a pair of trivial grammar fixes. :)


Michael.
diff --git a/buildservice/src/clientlib/python/osc/osc/commandline.py
b/buildservice/src/clientlib/python/osc/osc/commandline.py
index 1e02406..810ac41 100755
--- a/buildservice/src/clientlib/python/osc/osc/commandline.py
+++ b/buildservice/src/clientlib/python/osc/osc/commandline.py
@@ -1539,8 +1539,10 @@ Please submit there instead, or use --nodevelproject to
force direct submission.
@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')
-
+ help='show only packages whose names match EXPR')
+ @cmdln.option('-p', '--project', metavar='PROJECT',
+ help='show packages in project PROJECT')
+
@cmdln.alias('pr')
def do_prjresults(self, subcmd, opts, *args):
"""${cmd_name}: Shows project-wide build results
@@ -1553,6 +1555,9 @@ Please submit there instead, or use --nodevelproject to
force direct submission.
2. osc prjresults
the project is guessed from the current dir

+ 3. osc prjresults --project=<project>
+ the project is specified from the command line
+
${cmd_usage}
${cmd_option_list}
"""
@@ -1561,13 +1566,17 @@ Please submit there instead, or use --nodevelproject to
force direct submission.
print >>sys.stderr, 'getting results for more than one project is
not supported'
return 2

- if args:
- wd = args[0]
+ if opts.project:
+ project = opts.project
+ apiurl = conf.config['apiurl']
else:
- wd = os.curdir
+ if args:
+ wd = args[0]
+ else:
+ wd = os.curdir

- project = store_read_project(wd)
- apiurl = store_read_apiurl(wd)
+ project = store_read_project(wd)
+ apiurl = store_read_apiurl(wd)

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))

@@ -1579,7 +1588,7 @@ Please submit there instead, or use --nodevelproject to
force direct submission.
@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')
+ help='show only packages whose names match EXPR')

def do_rprjresults(self, subcmd, opts, prj):
"""${cmd_name}: Shows project-wide build results of remote Projects
< Previous Next >
Follow Ups