-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrepl.py
61 lines (51 loc) · 1.72 KB
/
repl.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
"""Take the call numbers and routes them to commands."""
import logging
import display
import queries
from map_fields import get_field_int
def repl(dataframe, call, command, arg1, arg2):
if call == 1:
return display.display_list(queries.query_list(dataframe))
logging.debug("calling query and display for " + command)
elif call == 2:
return display.display_show(queries.query_show(dataframe, arg1))
logging.debug(
"calling query and display for " +
command +
" with arg " +
arg1)
elif call == 3:
return display.display_show_with_field(
queries.query_show_field(
dataframe, arg1, get_field_int(arg2)))
logging.debug(
"calling query and display for " +
command +
" with args " +
arg1 +
", " +
arg2)
elif call == 4:
return (display.display_search(queries.query_search(dataframe, arg1)))
logging.debug(
"calling query and display for " +
command +
" with arg " +
arg1)
elif call == 5:
return display.display_search_with_field(
queries.query_search_field(
dataframe, get_field_int(arg1), arg2))
logging.debug(
"calling query and display for " +
command +
" with args " +
arg1 +
", " +
arg2)
elif call == 7:
return display.display_help()
logging.debug("calling query and display for " + command)
elif call == 8:
return display.display_help_with_command(arg1)
logging.debug("calling query and display for " + command)