-
Notifications
You must be signed in to change notification settings - Fork 0
/
prpr_commands.py
executable file
·37 lines (35 loc) · 1.39 KB
/
prpr_commands.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
__author__ = 'Nina Stawski'
__version__ = '0.32'
def CheckCommand(command):
"""
Returns the command type and the generic command, if the command exists.
"""
commandList = {
'definition' : {
'name' : ['NAME'],
'table' : ['TABLE'],
'"""' : ['"""', '"""""', '""""""', '"""""""', '""""""""','DOC', 'ENDDOC'],
'plate' : ['PLATE'],
'component' : ['COMPONENT', 'REAGENT', 'LOCATION'],
'volume' : ['VOLUME', 'AMOUNT'],
'recipe' : ['RECIPE', 'LIST', 'SET'],
'comment' : ['COMMENT', '%']
},
'action' : {
'use' : ['USE'],
'make' : ['MAKE', 'PREPARE_LIST'],
'spread' : ['SPREAD', 'DISTRIBUTE', 'DIST_REAGENT'],
'transfer' : ['TRANSFER', 'TRANSFER_LOCATIONS'],
'message' : ['MESSAGE', 'PROMPT'],
'move' : ['MOVE'],
'wait' : ['WAIT']
},
'function' : {
'protocol' : ['TEMPLATE', 'PROTOCOL'],
'endprotocol' : ['ENDTEMPLATE', 'ENDPROTOCOL']
}
}
for type in commandList.keys():
for keyword in commandList[type].keys():
if command.upper() in commandList[type][keyword]:
return { 'type' : type, 'name' : keyword }