-
Notifications
You must be signed in to change notification settings - Fork 30
/
cli_ui.py
34 lines (26 loc) · 1013 Bytes
/
cli_ui.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
# Instead of GUI, just prompt on the command line
class cli_ui:
qtAvailable = False
def yes_no_box(self, question):
while True:
response = raw_input("{} (Y/N)".format(question))
if len(response) < 1 or response[0] not in ['y','n','N','Y']:
continue
if response[0].lower() == 'y':
return True
else:
return False
def update_table(self, newTable):
#TODO: Not showing a table for now
pass
def text_input_box(self, promptText):
return raw_input(promptText + "? ").strip()
def impCallsOptions(self):
options = ["nop", "hook", "cancel"]
print ("Code contains calls to imported functions. How should this be handled?")
while True:
selection = raw_input("({})?".format(", ".join(options))).strip()
if selection in options:
return selection
def save_file(self, codeobj):
print codeobj.final