From 949a27abafde47942a9e0354f28a3270a94640a2 Mon Sep 17 00:00:00 2001 From: Adrien Lemaire Date: Mon, 15 Apr 2013 22:56:02 +0900 Subject: handle case log file does not exists --- examples/pomodoro.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'examples/pomodoro.py') diff --git a/examples/pomodoro.py b/examples/pomodoro.py index 7af996b..2094448 100644 --- a/examples/pomodoro.py +++ b/examples/pomodoro.py @@ -97,6 +97,9 @@ class Py3status: * pause * stop (default) """ + if not os.path.isfile(LOG_FILE): + return 'stop' + with open(LOG_FILE, 'r') as f: status = f.read() -- cgit v1.3