summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2010-02-07 16:03:50 +0100
committerJiri Moskovcak <jmoskovc@redhat.com>2010-02-07 16:03:50 +0100
commit34fc227339ccd23b30973ea4684fcb6fb408635e (patch)
treec47ba01ecdc6e0e2ab5fc38c5eb07c4d6deeeedd /scripts
parent985908c6b086b83381eccd95a0a6508c8bf1d731 (diff)
parent1e76e071620e1f9bf110dacf3cf8caffccef324b (diff)
downloadabrt-34fc227339ccd23b30973ea4684fcb6fb408635e.tar.gz
abrt-34fc227339ccd23b30973ea4684fcb6fb408635e.tar.xz
abrt-34fc227339ccd23b30973ea4684fcb6fb408635e.zip
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/abrt-bz-stats35
1 files changed, 29 insertions, 6 deletions
diff --git a/scripts/abrt-bz-stats b/scripts/abrt-bz-stats
index 5e253912..d84fd55e 100755
--- a/scripts/abrt-bz-stats
+++ b/scripts/abrt-bz-stats
@@ -29,6 +29,8 @@ parser.add_option("-w", "--weekly", help="Generate weekly report instead of mont
# HTML output for blogs etc.
parser.add_option("-t", "--html", help="Generate HTML output",
action="store_true", default=False, dest="html")
+parser.add_option("-i", "--wiki", help="Generate output in wiki syntax",
+ action="store_true", default=False, dest="wiki")
# Newest stats first
parser.add_option("-r", "--reversed", help="Display the newest stats first",
action="store_true", default=False, dest="reversed")
@@ -139,7 +141,8 @@ class TimeSpan:
return int(100 * self.closed_as_waste / self.closed())
def closed_as_other_percentage(self):
- return int(100 * self.closed_as_other / self.closed())
+ return 100 - self.closed_as_useful_percentage() \
+ - self.closed_as_waste_percentage()
def closed(self):
return self.closed_as_useful + self.closed_as_waste + self.closed_as_other
@@ -151,13 +154,16 @@ class TimeSpan:
self.components[component] = 1
def add_resolution(self, resolution):
- if resolution in ["CLOSED_NOTABUG", "CLOSED_WONTFIX", "CLOSED_DEFERRED", "CLOSED_WORKSFORME"]:
- self.closed_as_other += 1
- elif resolution in ["CLOSED_CURRENTRELEASE", "CLOSED_RAWHIDE", "CLOSED_ERRATA", \
- "CLOSED_UPSTREAM", "CLOSED_NEXTRELEASE"]:
+ # Catches only resolutions starting with "CLOSED_"
+ if resolution in ["CLOSED_CURRENTRELEASE", "CLOSED_RAWHIDE", "CLOSED_ERRATA",
+ "CLOSED_UPSTREAM", "CLOSED_NEXTRELEASE"]:
self.closed_as_useful += 1
- elif resolution in ["CLOSED_DUPLICATE", "CLOSED_CANTFIX", "CLOSED_INSUFFICIENT_DATA"]:
+ elif resolution in ["CLOSED_DUPLICATE", "CLOSED_CANTFIX",
+ "CLOSED_INSUFFICIENT_DATA"]:
self.closed_as_waste += 1
+ elif resolution in ["CLOSED_NOTABUG", "CLOSED_WONTFIX",
+ "CLOSED_DEFERRED", "CLOSED_WORKSFORME"]:
+ self.closed_as_other += 1
def __str__(self):
def bug(count):
@@ -195,6 +201,19 @@ class TimeSpan:
top_crasher_item = " <li>%s: %s</li>\n"
top_crashers_end = "</ol></li>\n"
end = "</ul>\n"
+ elif options.wiki:
+ start = ""
+ bugs_reported = "* %s reported\n"
+ bugs_closed = "* %s closed\n"
+ bugs_cl_useful = "** %s (%d%%) as fixed, so ABRT was useful\n"
+ bugs_cl_notuseful = "** %s (%d%%) as duplicate, can't fix, insuf. data, so ABRT was not useful\n"
+ bugs_cl_other = "** %s (%d%%) as notabug, wontfix, worksforme\n"
+ bugs_closed_end = ""
+ top_crashers = "* top crashers:\n"
+ top_crasher_item = "*# %s: %s\n"
+ top_crashers_end = ""
+ end = ""
+
str = start
str += bugs_reported % bug(self.bugs_reported())
@@ -273,6 +292,8 @@ if not options.weekly:
m = monthly_stats[month]
if options.html:
print "<h2>Month %s</h2>" % month
+ elif options.wiki:
+ print "==Month %s==" % month
else:
print "MONTH %s" % month
print m
@@ -285,6 +306,8 @@ else:
w = weekly_stats[week]
if options.html:
print "<h2>Week %s</h2>" % week
+ elif options.wiki:
+ print "==Week %s==" % week
else:
print "WEEK %s" % week
print w