Commit fb42d911 authored by unknown's avatar unknown

Added xml status

parent 0e647da1
...@@ -6,7 +6,7 @@ def PrintHeader(): ...@@ -6,7 +6,7 @@ def PrintHeader():
return '<html>\n<head>\n<title>Pronterface-Web</title>\n<link rel="stylesheet" type="text/css" href="/css/style.css" type="text/css"></link>\n</head>\n<body>\n' return '<html>\n<head>\n<title>Pronterface-Web</title>\n<link rel="stylesheet" type="text/css" href="/css/style.css" type="text/css"></link>\n</head>\n<body>\n'
def PrintMenu(): def PrintMenu():
return '<div id="mainmenu"><ul><li><a href="/">home</a></li><li><a href="/settings">settings</a></li><li><a href="/console">console</a></li></ul></div>' return '<div id="mainmenu"><ul><li><a href="/">home</a></li><li><a href="/settings">settings</a></li><li><a href="/console">console</a></li><li><a href="/status">status (XML)</a></li></ul></div>'
def PrintFooter(): def PrintFooter():
return "</body></html>" return "</body></html>"
...@@ -94,6 +94,12 @@ class PauseButton(object): ...@@ -94,6 +94,12 @@ class PauseButton(object):
return ReloadPage("Pause...") return ReloadPage("Pause...")
index.exposed = True index.exposed = True
class XMLstatus(object):
def index(self):
#handle connect push, then reload page
return '<?xml version="1.0"?>\n<xml>\n <status>'+gPronterPtr.status.GetStatusText()+'</status>\n</xml>';
index.exposed = True
class WebInterface(object): class WebInterface(object):
def __init__(self, pface): def __init__(self, pface):
...@@ -114,6 +120,7 @@ class WebInterface(object): ...@@ -114,6 +120,7 @@ class WebInterface(object):
reset = ResetButton() reset = ResetButton()
printbutton = PrintButton() printbutton = PrintButton()
pausebutton = PrintButton() pausebutton = PrintButton()
status = XMLstatus()
def index(self): def index(self):
pageText=PrintHeader()+self.name+PrintMenu() pageText=PrintHeader()+self.name+PrintMenu()
......
Markdown is supported
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