changeset 2450:c602b4c69310

Hotfix: Pseudo failure in pythonServer for 3.x
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Tue, 02 Aug 2016 10:35:43 +0100
parents aafa38291420
children 48a84568359c
files python/pythonServer.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/python/pythonServer.py	Mon Jul 11 21:46:00 2016 +0100
+++ b/python/pythonServer.py	Tue Aug 02 10:35:43 2016 +0100
@@ -28,6 +28,7 @@
 
 PSEUDO_PATH = '../tests/'
 pseudo_files = []
+pseudo_index = 0
 for filename in os.listdir(PSEUDO_PATH):
     print(filename)
     if filename.endswith('.xml'):
@@ -221,6 +222,7 @@
     s.end_headers()
 
 def http_do_GET(request):
+    global pseudo_index
     if(request.client_address[0] == "127.0.0.1"):
         if (request.path == "/favicon.ico"):
             send404(request)
@@ -233,7 +235,7 @@
             if (request.path == '/'):
                 request.path = '/index.html'
             elif (request.path == '/pseudo.xml'):
-                request.path = '/'+PSEUDO_PATH + pseudo_files[pseudo_index]
+                request.path = PSEUDO_PATH + pseudo_files[pseudo_index]
                 print(request.path)
                 pseudo_index += 1
                 pseudo_index %= len(pseudo_files)