if __name__ == "__main__": # Configure paths if options.rootsavedata is True: config.saveInRoot = True config.debug = options.debug config.defPaths() # Basic logging initialization import logging logging.basicConfig() # Import everything import wx import os import os.path import eos.db import service.prefetch from gui.mainFrame import MainFrame #Make sure the saveddata db exists if not os.path.exists(config.savePath): os.mkdir(config.savePath) eos.db.saveddata_meta.create_all() pyfa = wx.App(False) MainFrame() pyfa.MainLoop()
else: pyfalog.info("Running in a thawed state.") # Lets get to the good stuff, shall we? import eos.db import eos.events # todo: move this to eos initialization? # noinspection PyUnresolvedReferences import service.prefetch # noqa: F401 # Make sure the saveddata db exists if not os.path.exists(config.savePath): os.mkdir(config.savePath) eos.db.saveddata_meta.create_all() from gui.mainFrame import MainFrame # set title if it wasn't supplied by argument if options.title is None: options.title = "pyfa %s - Python Fitting Assistant" % ( config.getVersion()) pyfa = wx.App(False) mf = MainFrame(options.title) ErrorHandler.SetParent(mf) pyfa.MainLoop() # TODO: Add some thread cleanup code here. Right now we bail, and that can lead to orphaned threads or threads not properly exiting. sys.exit()
# noinspection PyUnresolvedReferences import service.prefetch # noqa: F401 # Make sure the saveddata db exists if not os.path.exists(config.savePath): os.mkdir(config.savePath) eos.db.saveddata_meta.create_all() from gui.mainFrame import MainFrame # set title if it wasn't supplied by argument if options.title is None: options.title = "pyfa %s - Python Fitting Assistant" % (config.getVersion()) pyfa = wx.App(False) mf = MainFrame(options.title, options) if options.fit is not None: try: import base64 fit_bytes = base64.b64decode(options.fit) fit_string = fit_bytes.decode('UTF-8') mf.doImport(fit_string) # fit_parsed = mf.getActiveFit() # from eos.db import getFit # fit_db = getFit(fit_parsed) # from service.port import Port # exp = Port().exportFitStats(fit_db) except: import json print(json.dumps({