From 0e330e9504dfba0df5136ceb72f3f964ab8dd6db Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Thu, 20 Jun 2013 02:49:45 +0200 Subject: Don't spam me no more --- scripts/status_script.py | 6 +++++- scripts/sub_api.py | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/status_script.py b/scripts/status_script.py index 29a1e97..a92d5bf 100755 --- a/scripts/status_script.py +++ b/scripts/status_script.py @@ -17,7 +17,11 @@ class SublabStatus(object): return self.json def door_status(self): - self.get_json() + try: + self.get_json() + except Exception: + return 'unkown' + door_status = self.json['door.lock'] if door_status['ts'] + 120 < time.time(): diff --git a/scripts/sub_api.py b/scripts/sub_api.py index 31fa3c9..959359f 100644 --- a/scripts/sub_api.py +++ b/scripts/sub_api.py @@ -24,7 +24,8 @@ try: door_status = status_json["door.lock"]["text"] sublab_status["open"] = status_dict[door_status] except Exception: - sys.excepthook(*sys.exc_info()) + pass + #sys.excepthook(*sys.exc_info()) #atomically place new status new_output_file = output_file + '.new' -- cgit v1.2.1