status-report-scripts bugzillaReport.py,1.1,1.2
Rakesh Pandit
rakesh at fedoraproject.org
Wed Nov 12 01:31:39 UTC 2008
Author: rakesh
Update of /cvs/fedora/status-report-scripts
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv31342
Modified Files:
bugzillaReport.py
Log Message:
fix sorting based on number of requests met and added timespan in each report
Index: bugzillaReport.py
===================================================================
RCS file: /cvs/fedora/status-report-scripts/bugzillaReport.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- bugzillaReport.py 11 Nov 2008 23:40:48 -0000 1.1
+++ bugzillaReport.py 12 Nov 2008 01:31:38 -0000 1.2
@@ -284,8 +284,25 @@
pickle.dump(result, file_pickle)
list_of_names = result.keys()
+
+# Fox comparing based on value of result
+def cmp(x, y):
+ if result[x] == result[y]:
+ return 0
+ elif result[x] > result[y]:
+ return -1
+ else:
+ return 1
+
+# To sort based on alphabets
list_of_names.sort()
+
+# To sort based on names
+list_of_names.sort(cmp)
+
file = open('output.txt', 'w')
+file.write("From: " + str(start) + "\n")
+file.write("Upto: " + str(end) + "\n")
for i in range(0, list_of_names.__len__()):
file.write(list_of_names[i].encode('utf-8') + " - " + str(result[list_of_names[i]]))
file.write('\n')
More information about the fedora-extras-commits
mailing list