diff server/ts.py @ 27:dbbd503119ba

Add some web server handling
author Matt Johnston <matt@ucc.asn.au>
date Tue, 12 Jun 2012 00:09:09 +0800
parents d3e5934fe55c
children e3e0ed7758f9
line wrap: on
line diff
--- a/server/ts.py	Thu Jun 07 20:26:50 2012 +0800
+++ b/server/ts.py	Tue Jun 12 00:09:09 2012 +0800
@@ -11,7 +11,9 @@
 TESTING = True
 
 import sys
-#import httplib
+# for wrt
+sys.path.append('/root/python')
+import httplib
 import time
 import traceback
 
@@ -60,7 +62,7 @@
         if l == 'END\n':
             break
 
-        lines.append(l)
+        lines.append(l.rstrip('\n'))
 
     print lines
 
@@ -84,7 +86,7 @@
         print>>sys.stderr, "Bad CRC: calculated 0x%x vs received 0x%x\n" % (crc, recv_crc)
         return None
 
-    return ''.join(lines)
+    return lines
 
 @retry()
 def turn_off(sock):
@@ -115,7 +117,7 @@
     if not d:
         return
 
-    res = send_results()
+    res = send_results(d)
     if not res:
         return