msgproto: Convert static strings to a more generic enumeration system

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2019-03-05 12:42:35 -05:00 committed by KevinOConnor
parent 7d73a35805
commit db6e2d4c9e
5 changed files with 116 additions and 39 deletions

View file

@ -31,7 +31,6 @@ class SerialReader:
# Message handlers
handlers = {
'#unknown': self.handle_unknown, '#output': self.handle_output,
'shutdown': self.handle_output, 'is_shutdown': self.handle_output
}
self.handlers = { (k, None): v for k, v in handlers.items() }
def _bg_thread(self):