formatting of choices list

This commit is contained in:
rootzoll 2020-05-25 00:23:18 +02:00
parent 192a45022d
commit ccbab4e00f

View file

@ -493,7 +493,7 @@ if sys.argv[1] == "menu":
# create menu to select shop - TODO: also while loop list & detail until cancel or subscription # create menu to select shop - TODO: also while loop list & detail until cancel or subscription
choices = [] choices = []
for idx, hostEntry in enumerate(hosts): for idx, hostEntry in enumerate(hosts):
choices.append(["{0}".format(idx),"{0} ({1} hours, first: {2} sats, next: {3} sats)".format(hostEntry['name'].ljust(20), hostEntry['tor_bridge_duration_hours'], hostEntry['tor_bridge_price_initial_sats'], hostEntry['tor_bridge_price_extension_sats'])]) choices.append(("{0}".format(idx),"{0} ({1} hours, first: {2} sats, next: {3} sats)".format(hostEntry['name'].ljust(20), hostEntry['tor_bridge_duration_hours'], hostEntry['tor_bridge_price_initial_sats'], hostEntry['tor_bridge_price_extension_sats')))
d = Dialog(dialog="dialog",autowidgetsize=True) d = Dialog(dialog="dialog",autowidgetsize=True)
d.set_background_title("TOR Bridge Shop: {0}".format(shopurl)) d.set_background_title("TOR Bridge Shop: {0}".format(shopurl))
code, tag = d.menu("Following bridge hosts are available. Select for details:", choices) code, tag = d.menu("Following bridge hosts are available. Select for details:", choices)