| 90 | |
| 91 | |
| 92 | def list_channels(): |
| 93 | done = False |
| 94 | print("\tSelect channel:\n") |
| 95 | while not done: |
| 96 | channel_list = list(UpdateChannel) |
| 97 | for index, item in enumerate(channel_list): |
| 98 | print("\t%d)\t%s" % (index + 1, item.name)) |
| 99 | print("\t%d)\t%s" % (len(channel_list) + 1, "Main Menu")) |
| 100 | selection = input('Choice: ') |
| 101 | if selection.isdigit(): |
| 102 | selection = int(selection) |
| 103 | else: |
| 104 | selection = 0 |
| 105 | if (selection <= 0 or selection > len(channel_list) + 1): |
| 106 | print("%s is an invalid choice." % selection) |
| 107 | else: |
| 108 | done = True |
| 109 | if (selection != len(channel_list) + 1): |
| 110 | load_channel(channel_list[selection - 1].name) |
| 111 | |
| 112 | |
| 113 | def toggle_updates(): |