diff options
-rwxr-xr-x | update-blocker-wiki | 30 |
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 ...' |