(version)
| 48 | |
| 49 | |
| 50 | def select(version): |
| 51 | done = False |
| 52 | date = datetime.datetime.fromtimestamp(version.time).strftime('%c') |
| 53 | while not done: |
| 54 | print("Version:\t%s" % version.version) |
| 55 | print("Updated:\t%s" % date) |
| 56 | print("Notes:\n\n-----\n%s" % version.notes) |
| 57 | print("-----") |
| 58 | print("\t1)\tSwitch to version") |
| 59 | print("\t2)\tMain Menu") |
| 60 | selection = input('Choice: ') |
| 61 | if selection.isdigit(): |
| 62 | selection = int(selection) |
| 63 | else: |
| 64 | selection = 0 |
| 65 | if (selection == 2): |
| 66 | done = True |
| 67 | elif (selection == 1): |
| 68 | if (version.version == channel.latest_version.version): |
| 69 | print("Requesting update to latest version.") |
| 70 | else: |
| 71 | print("Requesting update to prior version.") |
| 72 | if are_auto_updates_enabled(): |
| 73 | print("Disabling automatic updates.") |
| 74 | set_auto_updates_enabled(False) |
| 75 | if (version.version == core_version_info()): |
| 76 | print("Already running %s" % version.version) |
| 77 | else: |
| 78 | print("version.version %s" % version.version) |
| 79 | print("core_version %s" % core_version_info()) |
| 80 | print("Downloading...") |
| 81 | print(version.update()) |
| 82 | print("Installing...") |
| 83 | if is_update_installation_pending: |
| 84 | #note that the GUI will be launched after update but should still do the upgrade headless |
| 85 | install_pending_update() |
| 86 | # forward updating won't work without reloading |
| 87 | sys.exit() |
| 88 | else: |
| 89 | print("Invalid selection") |
| 90 | |
| 91 | |
| 92 | def list_channels(): |
no test coverage detected