-
Notifications
You must be signed in to change notification settings - Fork 0
/
beth.py
executable file
·81 lines (66 loc) · 1.58 KB
/
beth.py
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
#!/usr/bin/env python3
from avionics.navigations import CoursePlotter
from sessions.exceptions import BethException, SessionWarning
from utils.trough.Troughs import Troughs
from src import args
modules = args.parse()
module = modules[0]
jobs = vars(modules[1])
try:
sessionTroughs = Troughs()
sessionTroughs.retrieve_all()
except SessionWarning as w:
print(w)
except Exception as f:
raise BethException(f)
def whats_up_doc(jobs):
options = {}
if 'mode' in jobs:
options.update({
'mode' : modules[1].mode
})
del jobs['mode']
if 'options' in jobs:
options.update({
'constants' : [modules[1].options]
})
del jobs['options']
if 'verbosity' in jobs:
options.update({
'verbosity' : modules[1].verbosity
})
del jobs['verbosity']
prepositions = [
'after',
'before',
'between'
]
for item in prepositions:
if item in jobs:
_dict = {
'prepositions' : { item : jobs[item] }
}
options.update(_dict)
del jobs[item]
return options
def the_most_important_function(jobs, options):
for job in jobs:
args = jobs[job]
try:
for target in jobs[job]:
CoursePlotter(
module,
job,
target,
*args,
sessionTroughs=sessionTroughs,
options=options
)
break
except KeyboardInterrupt:
break
except Exception as f:
f_name = str(type(f).__name__)
print(f_name, ':', f, '\n')
options = whats_up_doc(jobs)
the_most_important_function(jobs, options)