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

Function main

python/examples/version_switcher.py:117–149  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115
116
117def main():
118 global channel
119 done = False
120 load_channel(chandefault)
121 while not done:
122 print("\n\tBinary Ninja Version Switcher")
123 print("\t\tCurrent Install:\t%s" % get_install_directory())
124 print("\t\tCurrent User Path:\t%s" % user_directory())
125 print("\t\tCurrent Channel:\t%s" % channel.name)
126 print("\t\tCurrent Version:\t%s" % core_version_info())
127 print("\t\tAuto-Updates On:\t%s\n" % are_auto_updates_enabled())
128 for index, version in enumerate(versions):
129 date = datetime.datetime.fromtimestamp(version.time).strftime('%c')
130 print("\t%d)\t%s (%s)" % (index + 1, version.version, date))
131 print("\t%d)\t%s" % (len(versions) + 1, "Switch Channel"))
132 print("\t%d)\t%s" % (len(versions) + 2, "Toggle Auto Updates"))
133 print("\t%d)\t%s" % (len(versions) + 3, "Exit"))
134 selection = input('Choice: ')
135 if selection.isdigit():
136 selection = int(selection)
137 else:
138 selection = 0
139 if (selection <= 0 or selection > len(versions) + 3):
140 print("%d is an invalid choice.\n\n" % selection)
141 else:
142 if (selection == len(versions) + 3):
143 done = True
144 elif (selection == len(versions) + 2):
145 toggle_updates()
146 elif (selection == len(versions) + 1):
147 list_channels()
148 else:
149 select(versions[selection - 1])
150
151
152if __name__ == "__main__":

Callers 1

Calls 8

are_auto_updates_enabledFunction · 0.90
load_channelFunction · 0.85
get_install_directoryFunction · 0.85
core_version_infoFunction · 0.85
toggle_updatesFunction · 0.85
list_channelsFunction · 0.85
selectFunction · 0.85
user_directoryFunction · 0.50

Tested by

no test coverage detected