1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-08-23 06:48:51 +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

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