Cleanup of path reconstruction.

This commit is contained in:
Cas Cremers 2011-09-23 12:18:59 +02:00
parent a6bb143101
commit 4b62062765
2 changed files with 16 additions and 21 deletions

View File

@ -56,19 +56,22 @@ FirstCheck = True
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
""" """
The default path for the binaries is set in __init__.py in the (current) Get current directory (for this file)
directory 'Scyther'.
""" """
def getMyDir():
return os.path.dirname( os.path.realpath( __file__ ) )
def setBinDir(dir): """
global bindir The default path for the binaries is the current one.
"""
bindir = dir
def getBinDir(): def getBinDir():
global bindir return getMyDir()
return bindir """
Return Cache prefix path
"""
def getCacheDir():
return os.path.join(getMyDir(),"Cache")
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@ -276,12 +279,13 @@ class Scyther(object):
# Possibly we could also decide to store input and arguments in the cache to analyze things later # Possibly we could also decide to store input and arguments in the cache to analyze things later
path = "Cache/%s/%s/" % (uid1,uid2) # Construct: cachePath/uid1/uid2/...
path = os.path.join(getCacheDir(),uid1,uid2)
name1 = "%s.out" % (uid3) name1 = "%s.out" % (uid3)
name2 = "%s.err" % (uid3) name2 = "%s.err" % (uid3)
fname1 = path + name1 fname1 = os.path.join(path, name1)
fname2 = path + name2 fname2 = os.path.join(path, name2)
try: try:
""" """

View File

@ -20,12 +20,3 @@
# #
# Init this module # Init this module
# #
# The most important thing is to get the base directory right, in
# order to correctly find the executables
#
import Scyther
import os.path
bindir = __path__[0]
Scyther.setBinDir(bindir)