From 342750ca14247b0b29e6dbb837320a1cee967ed0 Mon Sep 17 00:00:00 2001 From: snarez Date: Fri, 5 Jul 2013 04:37:09 +1000 Subject: [PATCH] Graceful exit for views --- voltron.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/voltron.py b/voltron.py index 30c2fc1..ac3f987 100755 --- a/voltron.py +++ b/voltron.py @@ -131,6 +131,7 @@ def main(debugger=None, dict=None): except KeyboardInterrupt: pass inst.cleanup() + log.info('Exiting') # @@ -490,10 +491,10 @@ class Client (asyncore.dispatcher): try: msg = pickle.loads(data) log.debug('Received message: ' + str(msg)) + if self.view: + self.view.render(msg) except: log.debug('Invalid message: ' + data) - if self.view: - self.view.render(msg) # Parent class for all views