Commit aac2b605 authored by Guillaume Seguin's avatar Guillaume Seguin

Don't log requests and add tempreadings to rpc status report

parent dc4564d1
from SimpleXMLRPCServer import SimpleXMLRPCServer
from threading import Thread
from .utils import parse_temperature_report
RPC_PORT = 7978
class ProntRPC(object):
......@@ -9,7 +11,9 @@ class ProntRPC(object):
def __init__(self, pronsole, port = RPC_PORT):
self.pronsole = pronsole
self.server = SimpleXMLRPCServer(("localhost", port), allow_none = True)
self.server = SimpleXMLRPCServer(("localhost", port),
allow_none = True,
logRequests = False)
self.server.register_function(self.get_status, 'status')
self.thread = Thread(target = self.run_server)
self.thread.start()
......@@ -31,7 +35,12 @@ class ProntRPC(object):
eta = self.get_eta()
else:
eta = None
if self.pronsole.tempreadings:
temps = parse_temperature_report(self.pronsole.tempreadings)
else:
temps = None
return {"filename": self.pronsole.filename,
"progress": progress,
"eta": eta,
"temps": temps,
}
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