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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
#!/opt/homebrew/bin/python3
"""
ARGUMENTS FILE FOR WORKLOGGER
author: Wacky404
email: wacky404@dev.com
"""
from funcs_worklogger import configure
import argparse
class action_configure(argparse.Action):
def __init__(self, option_strings, dest, **kwargs):
return super().__init__(option_strings, dest, nargs=0, default=argparse.SUPPRESS, **kwargs)
def __call__(self, parser, namespace, values, option_strings, **kwargs):
configure(dir_list=None)
parser.exit()
parser = argparse.ArgumentParser(
prog='WorkLogger',
description="Log time efficiently, accurately, and reliably "
"directly from the terminal you work in.",
)
parser.add_argument(
'--configure',
action=action_configure,
help='check/create, log & output, directories that will be used in WorkLogger',
)
parser.add_argument(
'--log',
action='store',
default='INFO', # NOTSET=0, DEBUG=10, INFO=20, WARNING=30, ERROR=40, CRITICAL=50
help='DEBUG: Detailed information for diagnosing problems | '
'INFO: Confirmation that things are working | '
'WARNING: Indication that something unexpected happened. Program still running | '
'ERROR: Not able to perform some function of the program | '
'CRITICAL: Serious error, program may be unable to continue running',
)
parser.add_argument(
'--verbose',
action='store_true',
help='Turn on a verbose program when run',
)
parser.add_argument(
'job',
action='store',
help='(required) Add a job for the work done, to be logged with your insertion',
)
parser.add_argument(
'-p',
'--project',
action='store',
help='Add a project to for the work done, if in your config uses the value of the key inplace.',
)
parser.add_argument(
'-loc',
'--location',
action='store',
help='Add a location for the work done, to be logged with your insertion',
)
parser.add_argument(
'-t',
'--time',
action='store',
default=0,
help='Recorded in the unit of hours. Example: 0.5 is 30 minutes, recorded as 0.5hrs'
)
parser.add_argument(
'-s',
'--start',
action='store',
help='Add a start time for the work done, to be logged with your insertion. Use <now> for current time',
)
parser.add_argument(
'-e',
'--end',
action='store',
help='Add a end time for the work done, to be logged with your insertion. Use <now> for current time',
)
parser.add_argument(
'-m',
'--message',
action='store',
help='Add a message to accompany your worklog entry'
)
subparsers = parser.add_subparsers(help='subcommand help')
parser_merge = subparsers.add_parser(
'merge',
help='Merge Records of a job and specified file extension'
)
# Merge Functionality
parser_merge.add_argument(
'extension',
action='store',
choices=['csv', 'text', 'json'],
default='csv',
help='(required) Output file type, as a result of merge'
)
parser_merge.add_argument(
'--delete',
action='store_true',
default=False,
help='Delete the old individual files that will get merged into one file'
)
parser_email = subparsers.add_parser(
'email', help='Send an email of your worklog(s)')
# Email Functionality
parser_email.add_argument(
'-s',
'--sender',
action='store',
help='Whom will be sending the email, if email is provided in config this flag does not need to be used'
)
parser_email.add_argument(
'-r',
'--recipient',
required=True,
action='store',
help='(required) Whom will be recieving the email'
)
parser_email.add_argument(
'-p',
'--path',
nargs='+',
action='store',
required=True,
help='Path(s) to file or directory you want to email'
)
|