[gs-cvs] rev 8682 - trunk/cluster/tti

giles at ghostscript.com giles at ghostscript.com
Wed Apr 30 18:06:11 PDT 2008


Author: giles
Date: 2008-04-30 18:06:11 -0700 (Wed, 30 Apr 2008)
New Revision: 8682

Modified:
   trunk/cluster/tti/ciatest.py
Log:
XML-escape regression log messages before reporting them to cia.vc for posting 
on irc and statistics accumulation. Significant characters in some Ghostscript 
error messages can cause cia to silently drop the message.


Modified: trunk/cluster/tti/ciatest.py
===================================================================
--- trunk/cluster/tti/ciatest.py	2008-04-30 19:06:59 UTC (rev 8681)
+++ trunk/cluster/tti/ciatest.py	2008-05-01 01:06:11 UTC (rev 8682)
@@ -2,19 +2,22 @@
 
 # test script for submitting messages to CIA
 
-server = 'http://cia.navi.cx'
-project = 'ghostscript'
-module = 'gs'
+class Conf:
+  server = 'http://cia.navi.cx'
+  project = 'ghostscript'
+  module = 'gs'
+conf = Conf()
 
 import xmlrpclib
 import time
+from xml.sax import saxutils # for escaping the message text
 
 class Message:
-  def __init__(self, log='', rev=''):
+  def __init__(self, log='', rev='', module=conf.module):
     self.log = log
     self.rev = rev
-    self.server = server
-    self.project = project
+    self.server = conf.server
+    self.project = conf.project
     self.module = module
     self.name = 'manual test'
     self.version = '0.1'
@@ -39,7 +42,7 @@
     if self.rev:
       xml += '   <revision>' + self.rev + '</revision>\n'
     xml += '   <author>regression</author>\n'
-    xml += '   <log>' + str(self.log) + '</log>\n'
+    xml += '   <log>' + saxutils.escape(str(self.log)) + '</log>\n'
     xml += '  </commit>\n'
     xml += ' </body>\n'
     xml += ' <timestamp>' + str(int(time.time())) + '</timestamp>\n'
@@ -48,6 +51,7 @@
   def send(self, server = None):
     if not server: server = self.server
     xmlrpclib.ServerProxy(server).hub.deliver(self.message())
+    #print self.message()
   def __str__(self):
     return self.message()
 
@@ -58,6 +62,7 @@
   m.send()
 
 if __name__ == '__main__':
-  filename = 'regression-r7832.log'
+  rev = '8677'
+  filename = 'regression-r' + rev + '.log'
   print 'reporting results from \'%s\' to irc' % filename
-  irc_report(filename, '7832')
+  irc_report(filename, rev)



More information about the gs-cvs mailing list