This commit is contained in:
parent
ece40868e5
commit
6d0dab84eb
3 changed files with 5 additions and 2 deletions
|
@ -14,6 +14,8 @@ class BubaAnimation:
|
||||||
def run(self):
|
def run(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return f"<{type(self).__name__}>"
|
||||||
|
|
||||||
class BubaTime(BubaAnimation):
|
class BubaTime(BubaAnimation):
|
||||||
def __init__(self, buba: BubaCmd):
|
def __init__(self, buba: BubaCmd):
|
||||||
|
|
|
@ -15,7 +15,7 @@ class BubaCmd:
|
||||||
self.display = None
|
self.display = None
|
||||||
if not path.exists(serial):
|
if not path.exists(serial):
|
||||||
self.serial = None
|
self.serial = None
|
||||||
logging.warning(f"Unable to find serial port '{serial}', ignoring")
|
self.log.warning(f"Unable to find serial port '{serial}', ignoring")
|
||||||
if self.serial is not None:
|
if self.serial is not None:
|
||||||
self.display = MIS1TextDisplay(serial)
|
self.display = MIS1TextDisplay(serial)
|
||||||
self.send = send
|
self.send = send
|
||||||
|
|
|
@ -13,6 +13,7 @@ from buba.websocketcomm import WebSocketClients
|
||||||
config = AppConfig()
|
config = AppConfig()
|
||||||
if config.debug:
|
if config.debug:
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
app = Bottle()
|
app = Bottle()
|
||||||
if config.debug:
|
if config.debug:
|
||||||
|
@ -48,7 +49,7 @@ def websocket_endpoint(ws: WebSocket):
|
||||||
while True:
|
while True:
|
||||||
m = ws.receive()
|
m = ws.receive()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.debug("error in websocket", exc_info=e)
|
log.debug("error in websocket", exc_info=e)
|
||||||
pass
|
pass
|
||||||
finally:
|
finally:
|
||||||
websocket_clients.remove(ws)
|
websocket_clients.remove(ws)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue