diff options
author | David Tardon <dtardon@redhat.com> | 2013-12-07 16:31:32 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2013-12-07 16:37:04 +0100 |
commit | fa8d0cff3a8252c1e8476d724e12a7be50a557ab (patch) | |
tree | 28ce05be933d97fb16fa30852c57256dc37d560f | |
parent | 1ac7e398553b9fa998bac3d6a36fe50ceb5809d5 (diff) |
put bz URLs into a list to avoid repeated code
Change-Id: Iade61f598e1122aae7667de684a68e8164817327
-rwxr-xr-x | bin/get-bugzilla-attachments-by-mimetype | 50 |
1 files changed, 15 insertions, 35 deletions
diff --git a/bin/get-bugzilla-attachments-by-mimetype b/bin/get-bugzilla-attachments-by-mimetype index 97d9d2a84608..1d8ee8bca571 100755 --- a/bin/get-bugzilla-attachments-by-mimetype +++ b/bin/get-bugzilla-attachments-by-mimetype @@ -281,23 +281,26 @@ def get_launchpad_bugs(prefix): f.write(handle.read()) f.close() -freedesktop = 'http://bugs.libreoffice.org/buglist.cgi' -abisource = 'http://bugzilla.abisource.com/buglist.cgi' #added for abiword -gentoo = 'http://bugs.gentoo.org/buglist.cgi' -gnome = 'http://bugzilla.gnome.org/buglist.cgi' # added for gnumeric -kde = 'http://bugs.kde.org/buglist.cgi' # added for koffice/calligra -openoffice = 'https://issues.apache.org/ooo/buglist.cgi' +rss_bugzillas = { + 'abi': 'http://bugzilla.abisource.com/buglist.cgi', #added for abiword + 'fdo': 'http://bugs.libreoffice.org/buglist.cgi', + 'gentoo': 'http://bugs.gentoo.org/buglist.cgi', + 'gnome': 'http://bugzilla.gnome.org/buglist.cgi', # added for gnumeric + 'kde': 'http://bugs.kde.org/buglist.cgi', # added for koffice/calligra + 'mandriva': 'https://qa.mandriva.com/buglist.cgi', + 'moz': 'https://bugzilla.mozilla.org/buglist.cgi', + 'novell': 'https://bugzilla.novell.com/buglist.cgi', + 'ooo': 'https://issues.apache.org/ooo/buglist.cgi', +} + redhatrpc = 'https://bugzilla.redhat.com/xmlrpc.cgi' redhatbug = 'https://bugzilla.redhat.com/show_bug.cgi?id=' -mozilla = 'https://bugzilla.mozilla.org/buglist.cgi' -mandriva = 'https://qa.mandriva.com/buglist.cgi' #Novell Bugzilla requires users to log in in order to get details of the bugs such as attachment bodies etc. #As a dirty workaround, we parse comments containing "Created an attachment (id=xxxxxx)" and download attachments manually #python-bugzilla claims that it supports Novell bugzilla login but it's not working right now and novell bugzilla login #system is a nightmare novellattach = 'https://bugzilla.novell.com/attachment.cgi?id=' -novell = 'https://bugzilla.novell.com/buglist.cgi' mimetypes = { # ODF @@ -442,36 +445,13 @@ common_noncore_mimetypes = { 'application/pdf': 'pdf', } -for (mimetype,extension) in mimetypes.items(): - get_through_rss_query(freedesktop, mimetype, "fdo", extension) +for (prefix, uri) in rss_bugzillas.items(): + for (mimetype,extension) in mimetypes.items(): + get_through_rss_query(uri, mimetype, prefix, extension) for (mimetype,extension) in mimetypes.items(): get_through_rpc_query(redhatrpc, redhatbug, mimetype, "rhbz", extension) -for (mimetype,extension) in mimetypes.items(): - get_through_rss_query(openoffice, mimetype, "ooo", extension) - -for (mimetype,extension) in mimetypes.items(): - get_through_rss_query(novell, mimetype, "novell", extension) - -for (mimetype,extension) in mimetypes.items(): - get_through_rss_query(gnome, mimetype, "gnome", extension) - -for (mimetype,extension) in mimetypes.items(): - get_through_rss_query(abisource, mimetype, "abi", extension) - -for (mimetype,extension) in mimetypes.items(): - get_through_rss_query(kde, mimetype, "kde", extension) - -for (mimetype,extension) in mimetypes.items(): - get_through_rss_query(gentoo, mimetype, "gentoo", extension) - -for (mimetype,extension) in mimetypes.items(): - get_through_rss_query(mozilla, mimetype, "moz", extension) - -for (mimetype,extension) in mimetypes.items(): - get_through_rss_query(mandriva, mimetype, "mandriva", extension) - try: get_launchpad_bugs("lp") except ImportError: |