diff options
| author | Adrien Lemaire <lemaire.adrien@gmail.com> | 2013-04-15 22:56:02 +0900 |
|---|---|---|
| committer | Adrien Lemaire <lemaire.adrien@gmail.com> | 2013-04-15 22:56:02 +0900 |
| commit | 949a27abafde47942a9e0354f28a3270a94640a2 (patch) | |
| tree | eb9c3d5a95deee17f2d54130f3677b55162f01ba | |
| parent | 6b526bdc46cebb7d5f3df7d06eb2d723888ab854 (diff) | |
handle case log file does not exists
| -rw-r--r-- | examples/pomodoro.py | 3 |
1 files changed, 3 insertions, 0 deletions
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() |
