Skip to content

Commit

Permalink
Added a call to os.path.realpath() when creating pyfaPath to properly…
Browse files Browse the repository at this point in the history
… resolve symlinks. Also added a few linebreaks
  • Loading branch information
lydia committed Jan 26, 2014
1 parent d977645 commit 6728121
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def defPaths():
# Python 2.X uses ANSI by default, so we need to convert the character encoding
pyfaPath = getattr(configforced, "pyfaPath", None)
if pyfaPath is None:
pyfaPath = unicode(os.path.dirname(os.path.abspath(sys.modules['__main__'].__file__)), sys.getfilesystemencoding())
pyfaPath = unicode(os.path.dirname(os.path.realpath(os.path.abspath(
sys.modules['__main__'].__file__))), sys.getfilesystemencoding())

# Where we store the saved fits etc, default is the current users home directory
if saveInRoot is True:
Expand All @@ -46,7 +47,8 @@ def defPaths():
else:
savePath = getattr(configforced, "savePath", None)
if savePath is None:
savePath = unicode(os.path.expanduser(os.path.join("~", ".pyfa")), sys.getfilesystemencoding())
savePath = unicode(os.path.expanduser(os.path.join("~", ".pyfa")),
sys.getfilesystemencoding())

# Redirect stderr to file if we're requested to do so
stderrToFile = getattr(configforced, "stderrToFile", None)
Expand All @@ -62,7 +64,8 @@ def defPaths():
os.mkdir(savePath)
sys.stdout = open(os.path.join(savePath, "output_log.txt"), "w")

# Static EVE Data from the staticdata repository, should be in the staticdata directory in our pyfa directory
# 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
Expand Down

0 comments on commit 6728121

Please sign in to comment.