Make it even more friendly, but now only 2 base paths are customizable

This commit is contained in:
DarkPhoenix
2011-01-20 00:03:47 +03:00
parent 51dc4f4b05
commit 4776b290c4

View File

@@ -1,6 +1,13 @@
import os
import sys
# Load variable overrides specific to distribution type
try:
import configforced
forcedvars = dir(configforced)
except ImportError:
forcedvars = []
# Turns on debug mode
debug = False
@@ -14,17 +21,14 @@ expansionVersion = "1.1.0"
# The main pyfa directory which contains run.py
# Python 2.X uses ANSI by default, so we need to convert the character encoding
try:
if not "pyfaPath" in forcedvars:
pyfaPath = unicode(os.path.dirname(os.path.abspath(sys.modules['__main__'].__file__)),
sys.getfilesystemencoding())
# We don't have __file__ attribute of module __main__ for some cases (like frozen
# win32 executable)
except AttributeError:
pyfaPath = None
# Where we store the saved fits etc, default is the current users home directory
savePath = unicode(os.path.expanduser(os.path.join("~", ".pyfa")),
sys.getfilesystemencoding())
if not "savePath" in forcedvars:
savePath = unicode(os.path.expanduser(os.path.join("~", ".pyfa")),
sys.getfilesystemencoding())
# Static EVE Data from the staticdata repository, should be in the staticdata directory in our pyfa directory
staticPath = os.path.join(pyfaPath, "staticdata")
@@ -37,12 +41,6 @@ saveDB = os.path.join(savePath, "saveddata.db")
# maintenance script
gameDB = os.path.join(staticPath, "eve.db")
# Load variable overrides specific to distribution type
try:
from configforced import *
except ImportError:
pass
## DON'T MODIFY ANYTHING BELOW ##
import eos.config