kopia lustrzana https://github.com/jbruce12000/kiln-controller
cleanup, fixed "no handlers" message
rodzic
1a727b8a0e
commit
a3ca3e085d
|
@ -4,17 +4,17 @@ import bottle
|
||||||
from gevent.pywsgi import WSGIServer
|
from gevent.pywsgi import WSGIServer
|
||||||
from geventwebsocket import WebSocketHandler, WebSocketError
|
from geventwebsocket import WebSocketHandler, WebSocketError
|
||||||
|
|
||||||
from oven import Oven
|
|
||||||
from ovenWatcher import OvenWatcher
|
|
||||||
|
|
||||||
log_format = '%(asctime)s %(levelname)s %(name)s: %(message)s'
|
log_format = '%(asctime)s %(levelname)s %(name)s: %(message)s'
|
||||||
logging.basicConfig(level = logging.DEBUG, format = log_format)
|
logging.basicConfig(level = logging.DEBUG, format = log_format)
|
||||||
log = logging.getLogger("picoreflowd")
|
log = logging.getLogger("picoreflowd")
|
||||||
|
log.info("Starting picoreflowd")
|
||||||
|
|
||||||
|
from oven import Oven
|
||||||
|
from ovenWatcher import OvenWatcher
|
||||||
|
|
||||||
app = bottle.Bottle()
|
app = bottle.Bottle()
|
||||||
oven = Oven()
|
oven = Oven()
|
||||||
ovenWatcher = OvenWatcher(oven)
|
ovenWatcher = OvenWatcher(oven)
|
||||||
wsocks_control = []
|
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def index():
|
def index():
|
||||||
|
@ -41,7 +41,6 @@ def get_websocket_from_request():
|
||||||
@app.route('/control')
|
@app.route('/control')
|
||||||
def handle_control():
|
def handle_control():
|
||||||
wsock = get_websocket_from_request()
|
wsock = get_websocket_from_request()
|
||||||
wsocks_control.append(wsock)
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
message = wsock.receive()
|
message = wsock.receive()
|
||||||
|
@ -96,7 +95,6 @@ def get_profiles():
|
||||||
return json.dumps(profiles)
|
return json.dumps(profiles)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
log.info("Starting picoreflowd")
|
|
||||||
ip = "0.0.0.0"
|
ip = "0.0.0.0"
|
||||||
port = 8080
|
port = 8080
|
||||||
log.info("listening to %s:%d"%(ip,port))
|
log.info("listening to %s:%d"%(ip,port))
|
||||||
|
|
Ładowanie…
Reference in New Issue