diff options
author | Florian <stayawake@lavabit.com> | 2014-02-13 12:04:36 +0100 |
---|---|---|
committer | Florian <stayawake@lavabit.com> | 2014-02-13 12:04:36 +0100 |
commit | 963b45f4c04c4da390aa9faa12e82691ffcb2237 (patch) | |
tree | b86111074b9d9780244fd7ecec1c355845354b17 /scripts/status_script.py | |
parent | 2490960480bb39a5f775058119ba2a9eb42196fe (diff) |
status script checks now, if statusfile exists
Diffstat (limited to 'scripts/status_script.py')
-rwxr-xr-x | scripts/status_script.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/status_script.py b/scripts/status_script.py index 0f218d9..739cfcf 100755 --- a/scripts/status_script.py +++ b/scripts/status_script.py @@ -109,9 +109,12 @@ if __name__ == '__main__': s = SublabStatus() # read file with last status - with open(STATUSFILE, 'r') as status_file: - old_status = status_file.readline().rstrip() - last_change = status_file.readline().rstrip() + try: + with open(STATUSFILE, 'r') as status_file: + old_status = status_file.readline().rstrip() + last_change = status_file.readline().rstrip() + except Exception: + save_statusfile(STATUSFILE, s.door_status()) # check if status changed, if yes, update css and tweet it if s.door_status() != old_status: |