projects
/
blog.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
df6595d
)
emerge-lastsync.py: handle the never-synced case
author
W. Trevor King
<wking@tremily.us>
Sat, 8 Dec 2012 23:58:11 +0000
(18:58 -0500)
committer
W. Trevor King
<wking@tremily.us>
Sat, 8 Dec 2012 23:58:11 +0000
(18:58 -0500)
posts/conky/emerge-lastsync.py
patch
|
blob
|
history
diff --git
a/posts/conky/emerge-lastsync.py
b/posts/conky/emerge-lastsync.py
index 398524e7e8098c6bb81b8ab6b88fc2fb39f18c1a..9ef908aed869d1196fb7dc57c08a9ea28f31adda 100755
(executable)
--- a/
posts/conky/emerge-lastsync.py
+++ b/
posts/conky/emerge-lastsync.py
@@
-12,4
+12,7
@@
for line in open('/var/log/emerge.log', 'r'):
sync_time = int(line[:10])
syncs.append(sync_time)
-print(time.strftime('%a, %b %e', time.localtime(syncs[-1])))
+if syncs:
+ print(time.strftime('%a, %b %e', time.localtime(syncs[-1])))
+else:
+ print('never')