-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOpenCastCmd.py
More file actions
32 lines (24 loc) · 895 Bytes
/
Copy pathOpenCastCmd.py
File metadata and controls
32 lines (24 loc) · 895 Bytes
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
def process(cmdlist):
# Verify that this is meant for OPENCAST
if 'OPENCAST ' in cmdlist[0:9]:
# remove'OPENCAST ' from string
cmdlist = cmdlist[9:]
cmdlist = cmdlist.split("::")
# pars cmdlist into new array
_cmdlist = []
for cmd in cmdlist:
# remove parenthesis and split into cmd and arguments lists
cmdarr = cmd.split('(', 1)
cmdarr[1] = cmdarr[1][:-1]
# split arguments string into array of arguments
cmdarr[1] = cmdarr[1].split(',')
# render arguments into usable data types
if cmdarr[1][0]:
_arg = []
for arg in cmdarr[1]:
_arg.append(eval(arg))
cmdarr[1] = _arg
else:
cmdarr[1] = []
_cmdlist.append(cmdarr)
return _cmdlist