-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmytime.py
More file actions
executable file
·29 lines (27 loc) · 1.37 KB
/
mytime.py
File metadata and controls
executable file
·29 lines (27 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/python2
import collections
import argparse
from softwatch import timelog
from softwatch import timenode
from run import run
import sys
import time
import os
import glob
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('action', help='log | report | start | stop | status')
parser.add_argument('pattern', help="pattern+", nargs='*')
parser.add_argument('-D', "--dir", help="log directory", type=str, default=os.path.expanduser(os.path.join("~",".mytime")))
parser.add_argument('-f', "--file", help="log file mask", type=str)
parser.add_argument("-t", "--tree", help="max depth of tree (default 1000), 0 for rating", type=int, default=1000)
parser.add_argument("-s", "--samples", help="show samples",action="store_true")
parser.add_argument("-d", "--duration", help="hide items with total duration less than d minutes (default )", type=float, default=5)
parser.add_argument("-m", "--percent", help="hide items with total duration less than dp percent (default 0)", type=float, default=0)
parser.add_argument("-b", "--begin", help="begin p days ago", type=float)
parser.add_argument("-e", "--end", help="end e days ago", type=float)
parser.add_argument("-r", "--relative", help="show time relative to 24h period", action="store_true")
args = parser.parse_args()
args.systray=None
run(args)
exit(0)