Web interface improved. Accepts analysis?analysis_name as arguments.
| | |
| | | print("here comes info on the args variable:") |
| | | print(kwargs.get('args',None)) |
| | | |
| | | |
| | | def testWebAnalysis(run, **kwargs): |
| | | print("Simulations are located in "+run.Dir.fullpath()) |
| | | print("\n\nStatistics file:") |
| | | print(run.Statistics.readText()) |
| | | |
| | | hosts=({'name':'natalie','address':'kabinet.penic.eu', 'runs':Runs, 'username':'samo', 'remotebasepath':'simulations-test/subdir/subdir'}, |
| | | {'name':'Hestia','address':'127.0.0.1', 'runs':Runs, 'username':'samo'}) |
| | | analyses={'analysis1':analyze,} |
| | | analyses={'analysis1':analyze,'webReport':testWebAnalysis} |
| | | |
| | | tsmgr.start(hosts, analyses=analyses) |
| | |
| | | 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, |
| | |
| | | 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) |