Closed anarcat closed 8 years ago
Look good, but will this keep the ability to read the log file from stdin too? I use it during debugging. :)
Another thing: If the default is good, the desktop file can be changed to drop the file argument.
you may want to check the fileinput module documentation. basically, it supports multiple files, compressed files and -
for stdin.
so:
glob('/var/log/battery-stats.csv*')
battery-log
was called (or in other words, like the default battery-graph
), so the desktop file can indeed drop the argumentfileinput
also supports using -
to parse stdin, and supports gzip filesso i guess i should just add another patch to fix the desktop file here?
so i rebased the branch and added a few more changes, including the desktop file change, hopefully that's good enough now!
Hm, after pulling these changes, the program do not work for me. :(
% src/battery-stats-graph /var/log/hjemmenett-battery-status.log
Traceback (most recent call last):
File "src/battery-stats-graph", line 44, in
I'm running on Debian Jessie.
right, sorry about that - fixed in #11.
in the hope to make this script more standard, follow the convention of loading the file automatically
this also supports compression, so those logs can be rotated. i also did a little style cleanup while i was there.