#1194 test python dialogs

This commit is contained in:
rootzoll 2020-05-22 19:24:46 +02:00
parent 58384cd712
commit 4a634725af
2 changed files with 32 additions and 1 deletions

View File

@ -586,7 +586,7 @@ echo ""
echo "*** RASPIBLITZ EXTRAS ***" echo "*** RASPIBLITZ EXTRAS ***"
# for setup schell scripts # for setup schell scripts
sudo apt-get -y install dialog bc sudo apt-get -y install dialog bc python3-dialog
# enable copy of blockchain from 2nd HDD formatted with exFAT # enable copy of blockchain from 2nd HDD formatted with exFAT
sudo apt-get -y install exfat-fuse sudo apt-get -y install exfat-fuse

View File

@ -0,0 +1,31 @@
#!/usr/bin/python3
import sys
import locale
from dialog import Dialog
# display config script info
if len(sys.argv) <= 1 or sys.argv[1] == "-h" or sys.argv[1] == "help":
print("manage ip2tor subscriptions for raspiblitz")
print("blitz.ip2tor.py menu")
sys.exit(1)
# basic settings
locale.setlocale(locale.LC_ALL, '')
###############
# MENU
###############
if sys.argv[1] == "menu":
d = Dialog(dialog="dialog",autowidgetsize=True)
d.set_background_title("IP2TOR Subscription Service")
code, tag = d.menu("OK, then you have two options:",
choices=[("(1)", "Leave this fascinating example"),
("(2)", "Leave this fascinating example")])
if code == d.OK:
print("OK --> ")
print(tag)
else:
print("Cancel")