* [gentoo-commits] gentoo commit in src/gwn: gmn_bugzie.py .cvsignore
@ 2013-09-29 14:22 Markos Chandras (hwoarang)
0 siblings, 0 replies; only message in thread
From: Markos Chandras (hwoarang) @ 2013-09-29 14:22 UTC (permalink / raw
To: gentoo-commits
hwoarang 13/09/29 14:22:30
Modified: gmn_bugzie.py .cvsignore
Log:
gmn_bugzie.py: Make it work again with latest bugzilla
Whitespace fixes
Revision Changes Path
1.2 src/gwn/gmn_bugzie.py
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gmn_bugzie.py?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gmn_bugzie.py?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/gmn_bugzie.py?r1=1.1&r2=1.2
Index: gmn_bugzie.py
===================================================================
RCS file: /var/cvsroot/gentoo/src/gwn/gmn_bugzie.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- gmn_bugzie.py 21 May 2008 00:34:05 -0000 1.1
+++ gmn_bugzie.py 29 Sep 2013 14:22:30 -0000 1.2
@@ -1,6 +1,7 @@
#!/usr/bin/python
import httplib, string, time, sys, os
+import urllib2
def strip(x):
'''Removes quotation marks
@@ -10,7 +11,7 @@
x=x[1:]
if x[-1]=='\"':
x=x[0:-1]
-
+
return x
def get_page(site, uri, header):
@@ -18,14 +19,10 @@
and a dictionary of header values, returns the
requested resource. Will return an empty string
if something goes wrong.'''
- conn = httplib.HTTPConnection(site)
- conn.request("GET",uri,'',header)
- response = conn.getresponse()
- if response.status == 200:
- page = response.read()
- else:
- page = ""
- return page
+ conn = urllib2.Request("https://"+site+uri, None, header)
+ response = urllib2.urlopen(conn)
+ page = response.read()
+ return page
def group_results(result, group_by, details):
'''Given a column to group by, will accumulate a count
@@ -40,11 +37,11 @@
the result more like 'select group_by, count(*), [column for column in details]
from bugzilla group by group_by, [column for column in details]'.'''
-
+
lines = result.split("\n")
field_names = string.split(lines[0],',')
-
+
by_group = {}
detailDict = {}
for line in lines[1:]:
@@ -53,7 +50,7 @@
#capture the first result for each unique group_by
if (by_group[b[group_by]] == 1):
detailDict[b[group_by]] = b
-
+
count_by_group = [[bug_count, group] for group, bug_count in by_group.items()]
count_by_group.sort()
@@ -65,9 +62,9 @@
'''Given a CSV generated from reports.cgi will return a dictionary
with the sum for each row. The grand total will also be added
to the 'Total' entry.'''
-
+
lines = result.split("\n")
-
+
result_dict = {}
total = 0
@@ -77,7 +74,7 @@
total += summed
result_dict[split_list[0]] = summed
result_dict['Total'] = total
-
+
return result_dict
# get dates from command line, else use now (time.time())
@@ -153,11 +150,13 @@
print "Major:%d" % severities.get('"major"',0)
cleft = 0
+#8. Closed Bugs
for i in range(0,9):
print "%s:%d" % (strip(groups_that_closed_most[i][2][0]), groups_that_closed_most[i][1])
cleft += groups_that_closed_most[i][1]
print "Others:%d" % (total_closed - cleft)
+#9. Open Bugs
oleft = 0
for i in range(0,9):
print "%s:%d" % (strip(groups_that_opened_most[i][2][0]), groups_that_opened_most[i][1])
1.2 src/gwn/.cvsignore
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/.cvsignore?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/.cvsignore?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/gwn/.cvsignore?r1=1.1&r2=1.2
Index: .cvsignore
===================================================================
RCS file: /var/cvsroot/gentoo/src/gwn/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 29 Sep 2013 14:06:09 -0000 1.1
+++ .cvsignore 29 Sep 2013 14:22:30 -0000 1.2
@@ -1 +1,2 @@
devaway.txt
+breport
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-09-29 14:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-29 14:22 [gentoo-commits] gentoo commit in src/gwn: gmn_bugzie.py .cvsignore Markos Chandras (hwoarang)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox