-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathasciigui.py
70 lines (59 loc) · 2.42 KB
/
asciigui.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
# PYTHON 3.9.1
"""
Tristan Anderson
takc1nqa@gmail.com
tanderson@vt.edu
Proceed Formally.
"""
# Fortune
"""
This universe shipped by weight, not by volume. Some expansion of the
contents may have occurred during shipment.
"""
import NMR_Analyzer as v
import daq_muncher, directory_sorter,sweep_averager,global_interpreter,spin_extractor,asciigui_backend
import datetime,pandas,os,numpy,gc,time,multiprocessing,variablenames,matplotlib
def main():
def options():
print("NMR Toolsuite options:")
functions = [asciigui_backend.DAQExtractor, asciigui_backend.DirSorter, asciigui_backend.SweepAverager, asciigui_backend.NMRAnalyzer, asciigui_backend.GlobalInterpreter, asciigui_backend.SpinCurves]
functionalities = ["DAQExtractor","DirSorter","SweepAverager","NMRAnalyzer","GlobalInterpreter", "SpinCurves"]
print('#'*(12+max([len(i) for i in functionalities])))
print(str("{0:1}{2:^7}{0:1}{1:^"+str(2+max([len(i) for i in functionalities]))+"}{0:1}").format('#','Functionality',"Mode"))
print('#'*(12+max([len(i) for i in functionalities])))
for index,value in enumerate(functionalities):
print(str("{0:^1}{2:^7}{0:^1}{1:^"+str(2+max([len(i) for i in functionalities]))+"}{0:1}").format('#',value,index))
print('#'*(12+max([len(i) for i in functionalities])))
print("What mode do you want the GUI in?")
c = input("Enter number in table above: ")
try:
return int(c)
except ValueError:
print("Invalid Input")
return options()
functions = [asciigui_backend.DAQExtractor, asciigui_backend.DirSorter, asciigui_backend.SweepAverager, asciigui_backend.NMRAnalyzer, asciigui_backend.GlobalInterpreter,asciigui_backend.SpinCurves]
optdict = dict(zip([i for i in range(len(functions))],functions))
home = os.getcwd()
while True:
c= options()
f = optdict[c]
f()
# Good idea to "clean up" so to set home directory, and return to it in-between functionalities.
os.chdir(home)
#while True:
#c= options()
#f = optdict[c]
#f()
"""
try:
f = optdict[c]
f()
except KeyError as e:
print("Something went wrong:",e)
print("Invalid Option")
"""
#print("NMR Toolsuite ASCII-GUI")
#rootdir=os.getcwd()
#cwd=rootdir
#fixeddirs, fixedfiles = lsdir(cwd)
main()