def import_export(): ch = Choose([], "Dump/Restore pseudocode details", 1) ch.list = ["Import", "Export"] ch.width = 25 ch.deflt = 1 c = ch.choose() if c > 0: pkl_file = pickle_file(c) if not pkl_file: print "error with file choice" return if c == 1: import_pseudocomments(pkl_file) elif c == 2: export_pseudocomments(pkl_file) else: print "moep"
# This script demonstrates the usage of the class-based chooser. # # Author: Gergely Erdelyi <*****@*****.**> #--------------------------------------------------------------------- from idaapi import Choose # # Modal chooser # # Get a modal Choose instance chooser = Choose([], "MyChooser", 1) # List to choose from chooser.list = ["First", "Second", "Third"] # Set the width chooser.width = 50 # Run the chooser ch = chooser.choose() # Print the results if ch > 0: print "You chose %d which is %s" % (ch, chooser.list[ch - 1]) else: print "Escape from chooser" # # Normal chooser # class MyChoose(Choose): """ You have to subclass Chooser to override the enter() method
# This script demonstrates the usage of the class-based chooser. # # Author: Gergely Erdelyi <*****@*****.**> #--------------------------------------------------------------------- from idaapi import Choose # # Modal chooser # # Get a modal Choose instance chooser = Choose([], "MyChooser", 1) # List to choose from chooser.list = [ "First", "Second", "Third" ] # Set the width chooser.width = 50 # Run the chooser ch = chooser.choose() # Print the results if ch > 0: print "You chose %d which is %s" % (ch, chooser.list[ch-1]) else: print "Escape from chooser" # # Normal chooser # class MyChoose(Choose): """ You have to subclass Chooser to override the enter() method """