From f039f4c3e44d77456521013030fb3e955e7d9a61 Mon Sep 17 00:00:00 2001
From: Miha <miha.fosnaric@fe.uni-lj.si>
Date: Mon, 25 Mar 2019 09:04:14 +0000
Subject: [PATCH] Merge branch 'master' of https://bitbucket.org/samop/trisurf-manager

---
 trisurf/WebTrisurf.py |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/trisurf/WebTrisurf.py b/trisurf/WebTrisurf.py
index 4b36ec9..287210d 100644
--- a/trisurf/WebTrisurf.py
+++ b/trisurf/WebTrisurf.py
@@ -11,7 +11,7 @@
 class TsWEB(http.server.BaseHTTPRequestHandler):
 	def do_GET(self):
 		parsed_path=urlparse(self.path)
-		"""	message_parts = [
+		message_parts = [
                 'CLIENT VALUES:',
                 'client_address=%s (%s)' % (self.client_address, self.address_string()),
                 'command=%s' % self.command,
@@ -30,14 +30,18 @@
 		for name, value in sorted(self.headers.items()):
 			message_parts.append('%s=%s' % (name, value.rstrip()))
 		message_parts.append('')
-		message = '<br>'.join(message_parts) """
+		message = '<br>'.join(message_parts)
 		self.send_response(200)
 		self.end_headers()
 		self.wfile.write(b"<h1>Trisurf-ng manager web interface</h1><hr>")
 		oldstdout=sys.stdout
-		process=subprocess.Popen (['/usr/bin/python3', sys.argv[0], '-s', '--html'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+		if(parsed_path.path=='/analysis'):
+			process=subprocess.Popen (['/usr/bin/python3', sys.argv[0], '--analysis', parsed_path.query, '--html'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+		else:
+			process=subprocess.Popen (['/usr/bin/python3', sys.argv[0], '-s', '--html'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 		stdout, stderr= process.communicate()
 		output=stdout.decode('ascii')
+		output=output+message
 		output=output.replace('\n','<BR>')
 		output=bytearray(output,'ascii')
 		self.wfile.write(output)

--
Gitblit v1.9.3