MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / select

Function select

python/examples/version_switcher.py:50–89  ·  view source on GitHub ↗
(version)

Source from the content-addressed store, hash-verified

48
49
50def 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
92def list_channels():

Callers 1

mainFunction · 0.85

Calls 5

are_auto_updates_enabledFunction · 0.90
set_auto_updates_enabledFunction · 0.90
install_pending_updateFunction · 0.90
core_version_infoFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected