From 0dd71e00f20f74595440b1c2488db2ac847a97b8 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 4 Oct 2012 03:39:13 -0400 Subject: [PATCH] Change the filtering so standard error is not captured. --- irkerhook.py | 7 ++++--- irkerhook.xml | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/irkerhook.py b/irkerhook.py index b1b2981..a8cde65 100755 --- a/irkerhook.py +++ b/irkerhook.py @@ -37,7 +37,7 @@ default_channels = "irc://chat.freenode.net/%(project)s,irc://chat.freenode.net/ # No user-serviceable parts below this line: # -import os, sys, commands, socket, urllib +import os, sys, commands, socket, urllib, subprocess from pipes import quote as shellquote try: import simplejson as json # Faster, also makes us Python-2.4-compatible @@ -370,8 +370,9 @@ def ship(extractor, commit, debug): # This is where we apply filtering if extractor.filtercmd: - data = do('%s %s' % (shellquote(extractor.filtercmd), - shellquote(json.dumps(metadata.__dict__)))) + cmd = '%s %s' % (shellquote(extractor.filtercmd), + shellquote(json.dumps(metadata.__dict__))) + data = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read() try: metadata.__dict__.update(json.loads(data)) except ValueError: diff --git a/irkerhook.xml b/irkerhook.xml index 0862dfb..748a202 100644 --- a/irkerhook.xml +++ b/irkerhook.xml @@ -324,6 +324,9 @@ print json.dumps(metadata) # end +Standard error is available to the hook for progress and +error messages. + -- 2.26.2