summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Laska <jlaska@redhat.com>2011-04-29 16:05:25 -0400
committerJames Laska <jlaska@redhat.com>2011-04-29 16:05:25 -0400
commit9ff9bd5f62fefd02bb92f1024c8e637521b0d112 (patch)
tree66cd19a2d41da1ac2cdada37508c21f1516fdbb4
parent5e02f1a93fe3c59a612b1b76ec1fea151b8a1e46 (diff)
downloadscripts-9ff9bd5f62fefd02bb92f1024c8e637521b0d112.tar.gz
scripts-9ff9bd5f62fefd02bb92f1024c8e637521b0d112.tar.xz
scripts-9ff9bd5f62fefd02bb92f1024c8e637521b0d112.zip
Display bugs in a more readable table instead. Any more work on the display side should really use some templating backend
-rwxr-xr-xupdate-blocker-wiki30
1 files changed, 25 insertions, 5 deletions
diff --git a/update-blocker-wiki b/update-blocker-wiki
index 79600bf..c367c3a 100755
--- a/update-blocker-wiki
+++ b/update-blocker-wiki
@@ -46,7 +46,7 @@ def to_encoding(ustring):
return u''
# Display list of bugs, organized by components
-def display_bugs_by_component(bugs_by_component, bugs_by_id):
+def wikilist_bugs(bugs_by_component, bugs_by_id):
buf = ''
components = sorted(bugs_by_component.keys())
for component in components:
@@ -58,6 +58,26 @@ def display_bugs_by_component(bugs_by_component, bugs_by_id):
buf += '* [https://bugzilla.redhat.com/show_bug.cgi?id=%s %s] (%s) - %s\n' % (b.bug_id, b.bug_id, b.bug_status, b.short_desc)
return buf
+# Display sortable table of bugs
+def wikitable_bugs(bugs_by_component, bugs_by_id):
+ buf = ''
+
+ components = sorted(bugs_by_component.keys())
+ if len(components) > 0:
+ buf = '''{| class="wikitable sortable"
+! Bug !! Component !! Status !! Description
+|- \n'''
+
+ for component in components:
+ # sorted list
+ bugs = sorted(bugs_by_component.get(component,[]))
+ for b in bugs:
+ b = bugs_by_id[b]
+ buf += '| [https://bugzilla.redhat.com/show_bug.cgi?id=%s %s] || %s || %s || %s\n' % (b.bug_id, b.bug_id, component, b.bug_status, b.short_desc)
+ buf += '|-\n'
+ buf += '|}\n'
+ return buf
+
def parse_args():
'''Set up the option parser'''
parser = optparse.OptionParser(usage="%prog [options]")
@@ -283,7 +303,7 @@ affecting %(component_count)s component{{plural:%(component_count)s||s}}.
''' % dict (bug_count=len(join_lists(accepted_blocker_by_component.values())),
component_count=len(accepted_blocker_by_component))
# Sorted list of approved bugs
- page_content += display_bugs_by_component(accepted_blocker_by_component, bugs_by_id)
+ page_content += wikitable_bugs(accepted_blocker_by_component, bugs_by_id)
# Display proposed blockers
page_content += '''
@@ -296,7 +316,7 @@ guidance on reviewing the following bugs, refer to
''' % dict (bug_count=len(join_lists(proposed_blocker_by_component.values())),
component_count=len(proposed_blocker_by_component))
# Sorted list of proposed bugs
- page_content += display_bugs_by_component(proposed_blocker_by_component, bugs_by_id)
+ page_content += wikitable_bugs(proposed_blocker_by_component, bugs_by_id)
# Display approved nths
page_content += '''
@@ -309,7 +329,7 @@ affecting %(component_count)s component{{plural:%(component_count)s||s}}.
component_count=len(accepted_nth_by_component))
# Sorted list of approved bugs
- page_content += display_bugs_by_component(accepted_nth_by_component, bugs_by_id)
+ page_content += wikitable_bugs(accepted_nth_by_component, bugs_by_id)
# Display proposed nths
page_content += '''
@@ -323,7 +343,7 @@ guidance on reviewing the following bugs, refer to [[QA:SOP_nth_bug_process]].
component_count=len(proposed_nth_by_component))
# Sorted list of proposed bugs
- page_content += display_bugs_by_component(proposed_nth_by_component, bugs_by_id)
+ page_content += wikitable_bugs(proposed_nth_by_component, bugs_by_id)
# Create mediawiki handle
if opts.verbose: print 'Connecting to mediawiki ...'