def b3char(self, widget, data=None): prog = MainGUI(self.options, Prefs(), 3) return prog.run()
options['gui'] = False options['rm_disease'] = True else: assert False, 'unhandled option' # Set our filename, if we have it if (len(args) > 0): options['filename'] = args[0] # Make sure we have a filename still if (not options['gui'] and options['filename'] == None): print "A filename is required" usage() # Now load up the appropriate class if (options['gui']): # We're waiting until now to import, so people just using CLI don't need # PyGTK installed, etc). Not that this program follows PEP8-recommended # practices anyway, but I *am* aware that doing this is discouraged. from eschalon.maingui import MainGUI prog = MainGUI(options, Prefs(), 1) else: prog = MainCLI(options, Prefs(), 1) # ... and run it return prog.run() if __name__ == '__main__': sys.exit(main())