Change the filtering so standard error is not captured.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 4 Oct 2012 07:39:13 +0000 (03:39 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 4 Oct 2012 07:39:13 +0000 (03:39 -0400)
irkerhook.py
irkerhook.xml

index b1b2981403e544253d1fd41bfa6e4e40aed29d27..a8cde654a2c3e8fa8e100ec028a3ae2f3f3fe738 100755 (executable)
@@ -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:
index 0862dfb141e4a02b2e24914b2eca012ae6e01e76..748a202d216b29cd4e4e8ffeaa24b6f8305706b5 100644 (file)
@@ -324,6 +324,9 @@ print json.dumps(metadata)
 # end
 </programlisting>
 
+<para>Standard error is available to the hook for progress and
+error messages.</para>
+
 </refsect2>
 
 </refsect1>