churning pie charts (with non-canonical prerequisites!)
authorhaftmann
Sat, 05 Apr 2014 10:03:04 +0200
changeset 56417 04d0083cb9e5
parent 56416 b9baecff0684
child 56418 c267a0feb63a
churning pie charts (with non-canonical prerequisites!)
Admin/churn
Admin/lib/Tools/churn
Admin/lib/Tools/churn_pie
Admin/lib/scripts/churn_pie
--- a/Admin/churn	Sat Apr 05 10:03:03 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-ADMIN="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; pwd)"
-cd "$ADMIN"
-hg churn --aliases user-aliases
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Admin/lib/Tools/churn	Sat Apr 05 10:03:04 2014 +0200
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+#
+# Author: Florian Haftmann, TU Muenchen
+#
+# DESCRIPTION: mercurial churn statistics for specified aliases file
+
+ALIAS="${1:-$ISABELLE_HOME/Admin/user-aliases}"
+shift
+
+cd "$(dirname "$ALIAS")"
+
+hg churn --aliases "$ALIAS" "$@"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Admin/lib/Tools/churn_pie	Sat Apr 05 10:03:04 2014 +0200
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+#
+# Author: Florian Haftmann, TU Muenchen
+#
+# DESCRIPTION: pie chart with mercurial churn statistics for specified aliases file
+
+ALIAS="${1:-$ISABELLE_HOME/Admin/user-aliases}"
+shift
+
+SCRIPT="$ISABELLE_HOME/Admin/lib/scripts/churn_pie"
+
+cd "$(dirname "$ALIAS")"
+
+hg churn --aliases "$ALIAS" | "$SCRIPT" "$@" 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Admin/lib/scripts/churn_pie	Sat Apr 05 10:03:04 2014 +0200
@@ -0,0 +1,23 @@
+#!/usr/bin/python
+
+import re
+from pychart import theme, pie_plot, area, fill_style, arrow, legend
+import sys
+
+re_entry = re.compile(R'^(.*\S+)\s+(\d+)\s*\**\s*$')
+
+theme.get_options()
+
+data = []
+
+for line in sys.stdin.readlines():
+    match = re_entry.match(line)
+    data.append((match.group(1), int(match.group(2))))
+
+plot = pie_plot.T(data = data, arc_offsets = [],
+  shadow = (2, -2, fill_style.gray50), label_offset = 10, arrow_style = arrow.a3)
+
+ar = area.T(size = (500, 500), legend = legend.T(), x_grid_style = None, y_grid_style = None)
+ar.add_plot(plot)
+
+ar.draw()