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

fix and rename osc pr --show-non-building

fix osc pr --show-non-building to actually do what it is supposed to
do. Change default to not do filtering by renaming the option to
--hide-disabled
This commit is contained in:
Ludwig Nussel 2010-08-04 16:44:51 +02:00
parent 40503680c1
commit a4a52b62ae
2 changed files with 17 additions and 13 deletions

View File

@ -3335,8 +3335,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
help='show results only for specified repo(s)')
@cmdln.option('-V', '--vertical', action='store_true',
help='list packages vertically instead horizontally')
@cmdln.option('-S', '--show-non-building', action='store_true',
help='Show also packages which are build disabled or excluded')
@cmdln.option('--hide-disabled', action='store_true',
help='hide packages that are disabled or excluded in all repos, also hide repos that have only disabled or excluded packages')
@cmdln.alias('pr')
def do_prjresults(self, subcmd, opts, *args):
"""${cmd_name}: Shows project-wide build results
@ -3358,7 +3358,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
wd = os.curdir
project = store_read_project(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, repo=opts.repo, arch=opts.arch, vertical=opts.vertical, show_non_building=opts.show_non_building))
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, arch=opts.arch, vertical=opts.vertical, hide_disabled=opts.hide_disabled))
@cmdln.option('-q', '--hide-legend', action='store_true',

View File

@ -3892,7 +3892,7 @@ def get_results(apiurl, prj, package, lastbuild=None, repository=[], arch=[], ve
return r
def get_prj_results(apiurl, prj, hide_legend=False, csv=False, status_filter=None, name_filter=None, arch=None, repo=None, vertical=None, show_non_building=None):
def get_prj_results(apiurl, prj, hide_legend=False, csv=False, status_filter=None, name_filter=None, arch=None, repo=None, vertical=None, hide_disabled=None):
#print '----------------------------------------'
r = []
@ -3931,7 +3931,7 @@ def get_prj_results(apiurl, prj, hide_legend=False, csv=False, status_filter=Non
targets.sort()
# filter option
if status_filter or name_filter or not show_non_building:
if status_filter or name_filter or hide_disabled:
pacs_to_show = []
targets_to_show = []
@ -3958,15 +3958,19 @@ def get_prj_results(apiurl, prj, hide_legend=False, csv=False, status_filter=Non
pacs_to_show.append(pkg)
#filter non building states
elif not show_non_building:
for pkg in status.keys():
print "RUN for", pkg
for repo in status[pkg].keys():
if status[pkg][repo] != "excluded" and status[pkg][repo] != "disabled":
pacs_to_show.append(pkg)
targets_to_show.append(repo)
break
elif hide_disabled:
enabled = {}
for pkg in status.keys():
showpkg = False
for repo in status[pkg].keys():
if status[pkg][repo] != "excluded" and status[pkg][repo] != "disabled":
enabled[repo] = 1
showpkg = True
if showpkg:
pacs_to_show.append(pkg)
targets_to_show = enabled.keys()
pacs = [ i for i in pacs if i in pacs_to_show ]
if len(targets_to_show):