Update of /cvsroot/boost/boost/tools/regression/xsl_reports/runner
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12567

Modified Files:
        collect_and_upload_logs.py 
Log Message:
Posting to Dart now works reliably given illegal XML result files.

Index: collect_and_upload_logs.py
===================================================================
RCS file: 
/cvsroot/boost/boost/tools/regression/xsl_reports/runner/collect_and_upload_logs.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- collect_and_upload_logs.py  23 May 2007 22:52:16 -0000      1.27
+++ collect_and_upload_logs.py  24 May 2007 20:23:49 -0000      1.28
@@ -57,6 +57,16 @@
     '': 'Boost_HEAD'
     }
 
+ascii_only_table = ""
+for i in range(0,256):
+    if chr(i) == '\n' or chr(i) == '\r':
+        ascii_only_table += chr(i)
+    elif i < 32 or i >= 0x80:
+        ascii_only_table += '?'
+    else:
+        ascii_only_table += chr(i)
+    
+
 def publish_test_logs(
     input_dirs,
     runner_id, tag, platform, comment_file, timestamp, user, source, run_type,
@@ -73,7 +83,9 @@
             if os.path.basename( file ) == 'test_log.xml':
                 utils.log( 'Publishing test log "%s"' % os.path.join(dir,file) 
)
                 if dart_server:
-                    log_dom = xml.dom.minidom.parse(os.path.join(dir,file))
+                    log_xml = 
open(os.path.join(dir,file)).read().translate(ascii_only_table)
+                    #~ utils.log( '--- XML:\n%s' % log_xml)
+                    log_dom = xml.dom.minidom.parseString(log_xml)
                     test = {
                         'library': 
log_dom.documentElement.getAttribute('library'),
                         'test-name': 
log_dom.documentElement.getAttribute('test-name'),
@@ -113,7 +125,7 @@
                                     'type': node.nodeName,
                                     'result': 
dart_status_from_result[node.getAttribute('result')],
                                     'timestamp': 
node.getAttribute('timestamp'),
-                                    'log': 
xml.sax.saxutils.escape(node.firstChild.data.encode('unicode_escape'))
+                                    'log': 
xml.sax.saxutils.escape(node.firstChild.data)
                                 })
                             submission_dom.documentElement.appendChild(
                                 test_dom.documentElement.cloneNode(1) )


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to