Skip to content
Snippets Groups Projects
Commit 80abfb04 authored by developer23's avatar developer23
Browse files

ver 4.0.5.1

- commit
parent 4324c8c7
Branches
No related merge requests found
......@@ -31,9 +31,6 @@ from mimetypes import types_map
from xmlhtml import *
from constants import *
from shell.ais_shell import *
......@@ -72,9 +69,14 @@ class GetHandler(BaseHTTPRequestHandler):
if self.path == '/':
self.path = "/html/ais_readers.html"
fname, ext = os.path.splitext(self.path)
fname, ext = os.path.splitext(self.path)
fname = self.path.lstrip("/")
with open(os.path.join(os.curdir, self.path.lstrip("/"))) as f:
if self.path.lstrip("/html") == 'settings.html':
CreateHTMLfromXML()
with open(os.path.join(os.curdir, fname)) as f:
self.send_response(200)
self.send_header('Content-type', types_map[ext])
self.end_headers()
......@@ -98,30 +100,23 @@ class GetHandler(BaseHTTPRequestHandler):
else:
pq = {}
# key = ''.join(pq['key'])
# value = ''.join(pq['value'])
f = ''.join(pq[FUNCTION])
# if pq[RTE] != None:
# seconds = int(''.join(pq[RTE]))
try:
if pq['key'] != None:
xmlKey = ''.join(pq['key'])
xmlValue = ''.join(pq['value'])
print xmlKey, xmlValue
SaveXML(xmlKey, xmlValue)
except Exception:
pass
f = ''.join(pq[FUNCTION])
device = ''.join(pq[DEVICE])
# if f == 'z':
# CreateHTMLfromXML()
# import webbrowser
# url = 'file:///' + os.path.join(os.getcwd(), 'settings.html')
# webbrowser.open_new_tab(url)
#SaveXML(key, value)
if GetBaseName() == AIS_MAIN or GetBaseName() == AIS_MAIN_EXE:
#log_dir = ''.join(pq[LOG_DIR])
log_dir = 'debug_log'
......@@ -154,7 +149,6 @@ class GetHandler(BaseHTTPRequestHandler):
return
if pq[DEVICE_TYPE] != None:
device_type = ''.join(pq[DEVICE_TYPE])
......@@ -165,7 +159,11 @@ class GetHandler(BaseHTTPRequestHandler):
edit_list_choise = ''.join(pq[EDIT_LIST])
if f == 'Z':
print urllib2.urlopen("/settings.html")
......@@ -511,7 +509,17 @@ class GetHandler(BaseHTTPRequestHandler):
# os.system('pkill -9 python')
# os.kill(os.getpid(), signal.SIGINT)
# elif sys.platform.startswith('win'):
# os._exit(0)
# os._exit(0)
# xmlKey = ''.join(pq['key'])
# xmlValue = ''.join(pq['value'])
# if xmlKey is not None:
# print xmlKey, xmlValue
# SaveXML(xmlKey, xmlValue)
return
except (Exception) as error_mess:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment