def main() -> None: args = parse_args(sys.argv[1:]) coloredlogs.install(milliseconds=True, level=args.logLevel) LOG.verbose("Logging Started") # We're waiting until now to import, so people just using CLI don't need # PyGTK installed, etc). I *am* aware that doing this is discouraged. if args.book is None and args.filename is None: import eschalon.bookchooser prog = eschalon.bookchooser.BookChooser() elif args.char: from eschalon.maingui import MainGUI prog = MainGUI(args.filename, Prefs(), args.book) elif args.map: from eschalon.mapgui import MapGUI prog = MapGUI(args.filename, Prefs(), args.book) else: from eschalon.maincli import MainCLI prog = MainCLI(args.filename, Prefs(), args.book, args) prog.run()
def b3char(self, widget, data=None): prog = MainGUI(self.options, Prefs(), 3) return prog.run()
elif (o in ('--reset-hunger')): options['gui'] = False options['reset_hunger'] = 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(), 2) else: prog = MainCLI(options, Prefs(), 2) # ... and run it return prog.run() if __name__ == '__main__': sys.exit(main())
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())
def launcher(widget): prog = MainGUI(None, Prefs(), book_id) prog.run()