-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
65 lines (51 loc) · 1.64 KB
/
main.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
import loive
import sys
import getopt
import pprint
def cmdLineHelp():
help_list = {
'-h' : 'List all commands',
'-q' : 'Exit shell',
'efx_local' : 'Lists all local devices',
'efx_global' : 'Lists all global devices / VST,AU plugins' ,
'pluginInfo' : 'Display all information about local/global plugin devices',
'version' : 'Display project version',
'print-summary' : 'Prints summary of ableton-project, tracks, plugins etc..' ,
'load' : 'Loads new als file',
'manufacturers' : 'Lists manufacturers of items that declare them' }
pprint.pprint(help_list)
def main(argv):
command_args = { '-h' : 'cmdLineHelp()',
'-q' : 'exit()',
'efx_local' : 'efx_local_print()',
'efx_global' : 'efx_global_print()',
'pluginInfo' : 'getPluginInfo()',
'version' : 'print_live_version()',
'print-summary' : 'print_summary()',
'load' : 'load_new = raw_input("Path to new file: ")',
'manufacturers' : 'list_manufacturers()'}
if len(argv) < 2:
sys.stderr.write("Usage: python main.py [-File] \n")
return 1
filename = argv[1]
command = None
inputfile = ''
lp = loive.Loive(filename)
while True:
if command in command_args:
if command == '-h':
exec(command_args[command])
elif command == '-q':
break
else:
if(command == 'load'):
exec(command_args[command])
print load_new
loadcmnd = 'lp = loive.Loive("' + load_new +'")'
exec(loadcmnd)
else:
cat_string = 'lp.' + command_args[command]
exec(cat_string)
command = raw_input('==> ')
if __name__ == "__main__":
main(sys.argv)