-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.py
More file actions
61 lines (52 loc) · 1.5 KB
/
start.py
File metadata and controls
61 lines (52 loc) · 1.5 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
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
import argparse
from app.textplot import QuickTextPlot
NAME = 'start.py'
DESCRIPTION = '''
A Python script to visualise text highlights.
'''
EPILOG = '''
This programme remains work in progress.
'''
def main():
'''Using `argparse` to initialise project.
For `argparse`, see:
https://docs.python.org/3/library/argparse.html
'''
parser = argparse.ArgumentParser(
prog=NAME,
description=DESCRIPTION.strip(),
epilog=EPILOG.strip(),
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument(
'name',
help='Unique project name required')
parser.add_argument(
'-a', '--anonymise',
action='store_const',
const='#',
default=None,
required=False,
dest='anonymise',
help='Overwrite alphanumerical characters with given value'),
parser.add_argument(
'-m', '--mix_colours',
action='store_true',
default=False,
required=False,
dest='mix_colours',
help='Mix colours of multiple highlights (experimental!)'),
parser.add_argument(
'-s', '--show',
action='store_true',
required=False,
dest='show',
help='Show plot in a separate window'),
parser.add_argument(
'-v', '--verbose',
action='store_true',
required=False,
dest='verbose',
help='Print status messages to console'),
_ = QuickTextPlot(parser.parse_args())
if __name__ == '__main__':
main()