diff --git a/config.py b/config.py index e6b3d2eab..315648f6e 100644 --- a/config.py +++ b/config.py @@ -14,7 +14,7 @@ saveInRoot = False # Version data version = "1.5.1" -tag = "git" +tag = "Stable" expansionName = "Oceanus" expansionVersion = "1.0" evemonMinVersion = "4081" diff --git a/pyfa.py b/pyfa.py index b80ae5d70..76b7ca336 100755 --- a/pyfa.py +++ b/pyfa.py @@ -84,7 +84,6 @@ if __name__ == "__main__": import os.path import eos.db - import eos.db.migration as migration import service.prefetch from gui.mainFrame import MainFrame @@ -92,15 +91,7 @@ if __name__ == "__main__": if not os.path.exists(config.savePath): os.mkdir(config.savePath) - if os.path.isfile(config.saveDB): - # If database exists, run migration after init'd database - eos.db.saveddata_meta.create_all() - migration.update(eos.db.saveddata_engine) - else: - # If database does not exist, do not worry about migration. Simply - # create and set version - eos.db.saveddata_meta.create_all() - eos.db.saveddata_engine.execute('PRAGMA user_version = %d'%config.dbversion) + eos.db.saveddata_meta.create_all() pyfa = wx.App(False) MainFrame() diff --git a/service/prefetch.py b/service/prefetch.py index 874d26595..56c8b5684 100644 --- a/service/prefetch.py +++ b/service/prefetch.py @@ -18,7 +18,11 @@ #=============================================================================== import threading +import config +import os import eos.types +import eos.db.migration as migration + class PrefetchThread(threading.Thread): def run(self): # We're a daemon thread, as such, interpreter might get shut down while we do stuff @@ -31,3 +35,24 @@ class PrefetchThread(threading.Thread): prefetch = PrefetchThread() prefetch.daemon = True prefetch.start() + +######## +# The following code does not belong here, however until we rebuild skeletons +# to include modified pyfa.py, this is the best place to put it. See GH issue +# #176 +# @ todo: move this to pyfa.py +######## + +#Make sure the saveddata db exists +if not os.path.exists(config.savePath): + os.mkdir(config.savePath) + +if os.path.isfile(config.saveDB): + # If database exists, run migration after init'd database + eos.db.saveddata_meta.create_all() + migration.update(eos.db.saveddata_engine) +else: + # If database does not exist, do not worry about migration. Simply + # create and set version + eos.db.saveddata_meta.create_all() + eos.db.saveddata_engine.execute('PRAGMA user_version = %d'%config.dbversion)