chore: replace print with logging and make robot conditional
All print statements in the main program, and components used by the main program, have been replaced with appropriate logging statements. The connection to the robot now only gets made when it's possible, otherwise only the microphone will be run. ref: N25B-119
This commit is contained in:
5
state.py
5
state.py
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
import signal
|
||||
import threading
|
||||
|
||||
@@ -16,12 +17,12 @@ class State(object):
|
||||
|
||||
def initialize(self):
|
||||
if self.is_initialized:
|
||||
print("Already initialized")
|
||||
logging.warn("Already initialized")
|
||||
return
|
||||
|
||||
self.exit_event = threading.Event()
|
||||
def handle_exit(_, __):
|
||||
print("Exiting.")
|
||||
logging.info("Exiting.")
|
||||
self.exit_event.set()
|
||||
signal.signal(signal.SIGINT, handle_exit)
|
||||
signal.signal(signal.SIGTERM, handle_exit)
|
||||
|
||||
Reference in New Issue
Block a user