Reworked config.py (better variable names autodetection)

This commit is contained in:
Niklas Bölter
2010-11-13 17:40:02 +01:00
parent f1abd40ffa
commit d2d1759601
5 changed files with 26 additions and 15 deletions

View File

@@ -1,20 +1,31 @@
import os.path
import os
import sys
# Turns on debug mode
debug = False
#Path autodetection, only change if it doesn't work
path = os.path.dirname(unicode(__file__, sys.getfilesystemencoding()))
# You can adjust these paths to your needs
# The main pyfa directory which contains run.py
pyfaPath = os.path.join(os.getcwd(), os.path.dirname(sys.modules['__main__'].__file__))
homePath = os.path.expanduser(os.path.join("~", ".pyfa"))
staticPath = homePath
saveddata = os.path.join(homePath, "saveddata.db")
gamedata = os.path.join(homePath, "eve.db")
# Where we store the saved fits etc, default is the current users home directory
savePath = os.path.expanduser(os.path.join("~", ".pyfa"))
# Static EVE Data from the staticdata repository, should be in the staticdata directory in our pyfa directory
staticPath = os.path.join(pyfaPath, "staticdata")
# The database where we store all the fits etc
saveDB = os.path.join(savePath, "saveddata.db")
# The database where the static EVE data from the datadump is kept.
# WARNING: This is not the standard sqlite datadump but a modified version for EOS
gameDB = os.path.join(staticPath, "eve.db")
## DON'T MODIFY ANYTHING BELOW ##
import eos.config
#Caching modifiers, disable all gamedata caching, its unneeded.
eos.config.gamedataCache = None
# saveddata db location modifier, shouldn't ever need to touch this
eos.config.saveddata_connectionstring = "sqlite:///" + saveddata + "?check_same_thread=False"
eos.config.gamedata_connectionstring = "sqlite:///" + gamedata + "?check_same_thread=False"
eos.config.saveddata_connectionstring = "sqlite:///" + saveDB + "?check_same_thread=False"
eos.config.gamedata_connectionstring = "sqlite:///" + gameDB + "?check_same_thread=False"