diff --git a/config.py b/config.py index 8ef67eb5c..c02d78a94 100644 --- a/config.py +++ b/config.py @@ -13,7 +13,9 @@ else: homePath = os.path.expanduser(os.path.join("~", ".pyfa")) staticPath = homePath saveddata = os.path.join(homePath, "saveddata.db") +gamedata = os.path.join(homePath, "eve.db") # saveddata db location modifier, shouldn't ever need to touch this import eos.config eos.config.saveddata_connectionstring = "sqlite:///" + saveddata +eos.config.saveddata_connectionstring = "sqlite:///" + gamedata \ No newline at end of file diff --git a/run.py b/run.py index f6f4feb92..ce119d9fb 100755 --- a/run.py +++ b/run.py @@ -19,6 +19,26 @@ #=============================================================================== import config + +import apsw +mem = apsw.Connection(":memory:") +disk = apsw.Connection(config.gamedata) +b = mem.backup("main", disk, "main") +try: + while not b.done: + b.step() +finally: + b.finish() + +print config.gamedata +print b.done +import eos.config +import sqlite3 +conn = sqlite3.connect(mem) +eos.config.gamedata_connectionstring = lambda: conn + +#print "failed to use apsw to copy gamedata to memory, continueing, but a bit slower" + from gui.mainFrame import MainFrame import wx import os diff --git a/service/prefetch.py b/service/prefetch.py index c04184198..6f3292764 100644 --- a/service/prefetch.py +++ b/service/prefetch.py @@ -20,20 +20,22 @@ import threading import service import eos.db +import time class PrefetchThread(threading.Thread): def run(self): # We're a daemon thread, as such, interpreter might get shut down while we do stuff # Make sure we don't throw tracebacks to console - try: - eos.db.getItemsByCategory("Skill", eager=("effects", "attributes", "attributes.info.icon", "icon")) - cMarket = service.Market.getInstance() - root = cMarket.getShipRoot() - for id, _ in root: - cMarket.getShipList(id) - except: - return + print "Prefetch started" + time.clock() -prefetch = PrefetchThread() -prefetch.daemon = True -prefetch.start() + eos.db.getItemsByCategory("Skill", eager=("effects", "attributes", "attributes.info.icon", "icon")) + cMarket = service.Market.getInstance() + root = cMarket.getShipRoot() + for id, _ in root: + cMarket.getShipList(id) + + print "Prefetch stopped", time.clock() +#prefetch = PrefetchThread() +#prefetch.daemon = True +#prefetch.start()