summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2012-03-09 15:21:18 +0100
committerJan Pokorný <jpokorny@redhat.com>2012-03-09 15:21:18 +0100
commitda9c29a6b924b7b2373d1ab176bd90489e2aef30 (patch)
tree4bd283fb3d93cb7bded138a66464396b89c606f0
downloadwatch-bz-da9c29a6b924b7b2373d1ab176bd90489e2aef30.tar.gz
watch-bz-da9c29a6b924b7b2373d1ab176bd90489e2aef30.tar.xz
watch-bz-da9c29a6b924b7b2373d1ab176bd90489e2aef30.zip
initial commit
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rwxr-xr-xwatch-bz38
1 files changed, 38 insertions, 0 deletions
diff --git a/watch-bz b/watch-bz
new file mode 100755
index 0000000..3a83e92
--- /dev/null
+++ b/watch-bz
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+# jpokorny@redhat.com (will be pleased to know about further enhancements)
+
+# usage:
+# 1. git clone git://git.fedorahosted.org/git/python-bugzilla
+# 2. edit BUGZILLA_ROOT below
+# 3. also edit COMPONENT as per example (or pass such string as a 1st argument)
+
+BUGZILLA_ROOT=~/wrkspc/python-bugzilla
+BUGZILLA=${BUGZILLA_ROOT}/bin/bugzilla
+export PYTHONPATH=$BUGZILLA_ROOT:$PYTHONPATH
+
+COMPONENT=luci,ricci,clustermon,conga,sunzi
+STATUS=OPEN
+
+REFRESH_INTERVAL=600 # [s], better not to drain bugzilla's power...
+SEP=@@@
+OUTPUT_FMT="%{component}$SEP%{bug_id}$SEP%{priority}$SEP%{status}$SEP%{short_desc}"
+
+if [ $# -ge 1 ]; then
+ if [[ "$1" = -* ]]; then
+ STATUS=$(echo "$1" | cut -c2-)
+ shift
+ fi
+ if [ $# -ge 1 ]; then
+ COMPONENT="$1"
+ fi
+fi
+
+watch -t --interval $REFRESH_INTERVAL \
+ "$BUGZILLA query -c $COMPONENT -t $STATUS --outputformat $OUTPUT_FMT \
+ | table_data $SEP \
+ | sed -u \
+ -e 's/urgent/URGENT/' \
+ -e 's/important/IMPORTANT/'"
+# todo: colours for priorities (rhbz#801626)
+#-e 's/\(urgent\)/\^\[\[31m\1\^\[\[0m/' \