-
Notifications
You must be signed in to change notification settings - Fork 0
/
region.py
executable file
·42 lines (26 loc) · 898 Bytes
/
region.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
#!/usr/bin/python
# Import external modules
import snack
#########################################
# Display the primary credentials screen
#########################################
def regionSelectScreen(help_text, selected_creds, curregion):
# Set up the main screen
regwin = snack.SnackScreen()
# Set the help line
regwin.pushHelpLine(help_text)
regions = ["DFW", "IAD", "ORD", "LON", "SYD"]
li = snack.Listbox(height = 10, width = 40, returnExit = 0)
for region in regions:
li.append(region, region)
li.setCurrent(curregion)
bb = snack.ButtonBar(regwin, (("o(k)", "ok", 'k'), ("(q)uit", "quit", 'q')))
g = snack.GridForm(regwin, "Select Region", 1, 4)
g.add(li, 0, 0)
g.add(bb, 0, 3, growx = 1)
result = g.runOnce()
regwin.finish()
if bb.buttonPressed(result) == "ok":
return li.current()
else:
return bb.buttonPressed(result)