import main.app as app import utils.args as a args = a.Args('Battle of Snakes', scale=1) app.launch(args)
'platformer2') _save_path_requires_subpaths = ['log'] for sprs in _save_path_requires_subpaths: try: os.makedirs(os.path.join(save_path, sprs)) except FileExistsError: pass # Prepare path if getattr(sys, 'frozen', False): import time t = time.time_ns() path = sys._MEIPASS sys.stdout = open(os.path.join(save_path, 'log', f'{t}.log'), 'w') sys.stderr = sys.stdout else: path = os.path.dirname(__file__) # Create args args = a.Args(scale=1, path=path, save_path=save_path) # Load settings settings.default_try_get_delim = '.' settings.load(path=os.path.join(save_path, 'settings.json'), default_path=os.path.join(path, 'src', 'default_settings.json')) app.launch(args)
logger.error('Exiting') return logger.info("Got id=%s, feedback=%s, _debug=%s" % (feed_id, _debug['feedback'], _debug)) # empty feed id -> error if not feed_id: return "error" return "success" if __name__ == "__main__": ps = uarg.Args() args = ps.get_args() logfile = 'log_flask.log' if args.log: logfile = args.log import logging.config logging.basicConfig(filename=logfile, format='%(asctime)s %(levelname)s %(message)s', level=logger.DEBUG) file_classifier = args.classifier file_vectorizer = args.vect # un-pickle classifier
def launch(args=a.Args()): app = App(f.FrontEnd(args), b.BackEnd(args), args) app.prepare() app.run()
import main.app as app import utils.args as a args = a.Args(scale=1) app.launch(args)
def launch(args=None): args = a.Args('Game') if args is None else args app = App(f.FrontEnd(args), b.BackEnd(args), args) app.prepare() app.run()