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