summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-02-09 12:55:53 +0100
committerMichael Stahl <mstahl@redhat.com>2012-02-13 00:25:02 +0100
commit66fa9be298149f9db2051adf693f84ae92d3af6d (patch)
treebc17fd7c3f2d35ea89b54475e10fa3586d1ff6e1 /bin
parent05c254ca0ecdd88c157a27fc6de561efe71db3e6 (diff)
get-bugzilla-attachments-by-mimetype: deduplicate
Diffstat (limited to 'bin')
-rwxr-xr-xbin/get-bugzilla-attachments-by-mimetype29
1 files changed, 14 insertions, 15 deletions
diff --git a/bin/get-bugzilla-attachments-by-mimetype b/bin/get-bugzilla-attachments-by-mimetype
index f6dba152492f..c26ec84cec2d 100755
--- a/bin/get-bugzilla-attachments-by-mimetype
+++ b/bin/get-bugzilla-attachments-by-mimetype
@@ -114,25 +114,24 @@ redhatbug = 'https://bugzilla.redhat.com/show_bug.cgi?id='
novell = 'https://bugzilla.novell.com/buglist.cgi'
mozilla = 'https://bugzilla.mozilla.org/buglist.cgi'
-get_through_rss_query(freedesktop, 'application/msword', "fdo", "doc")
-get_through_rss_query(freedesktop, 'application/rtf', "fdo", "rtf")
-get_through_rss_query(freedesktop, 'text/rtf', "fdo", "rtf")
-get_through_rss_query(freedesktop, 'text/spreadsheet', "fdo", "slk")
-get_through_rss_query(freedesktop, 'application/vnd.ms-powerpoint', "fdo", "ppt")
+mimetypes = [
+ ('application/msword', 'doc'),
+ ('application/rtf', 'rtf'),
+ ('text/rtf', 'rtf'),
+ ('text/spreadsheet', 'slk'),
+ ('application/vnd.ms-powerpoint', 'ppt'),
+]
-get_through_rpc_query(redhatrpc, redhatbug, 'application/msword', "rhbz", "doc")
-get_through_rpc_query(redhatrpc, redhatbug, 'application/rtf', "rhbz", "rtf")
-get_through_rpc_query(redhatrpc, redhatbug, 'text/rtf', "rhbz", "rtf")
-get_through_rpc_query(redhatrpc, redhatbug, 'text/spreadsheet', "rhbz", "slk")
-get_through_rpc_query(redhatrpc, redhatbug, 'application/vnd.ms-powerpoint', "rhbz", "ppt")
+for (mimetype,extension) in mimetypes:
+ get_through_rss_query(freedesktop, mimetype, "fdo", extension)
+
+for (mimetype,extension) in mimetypes:
+ get_through_rpc_query(redhatrpc, redhatbug, mimetype, "rhbz", extension)
#to-do, get attachments some other way, not inline in xml
#get_through_rss_query(novell, 'application/msword', "n", "doc")
-get_through_rss_query(openoffice, 'application/msword', "ooo", "doc")
-get_through_rss_query(openoffice, 'application/rtf', "ooo", "rtf")
-get_through_rss_query(openoffice, 'text/rtf', "ooo", "rtf")
-get_through_rss_query(openoffice, 'text/spreadsheet', "ooo", "slk")
-get_through_rss_query(openoffice, 'application/vnd.ms-powerpoint', "ooo", "ppt")
+for (mimetype,extension) in mimetypes:
+ get_through_rss_query(openoffice, mimetype, "ooo", extension)
# vim:set shiftwidth=4 softtabstop=4 expandtab: