diff --git a/gui/Scyther/Scyther.py b/gui/Scyther/Scyther.py index b2ff6ef..bab4155 100755 --- a/gui/Scyther/Scyther.py +++ b/gui/Scyther/Scyther.py @@ -56,19 +56,22 @@ FirstCheck = True #--------------------------------------------------------------------------- """ -The default path for the binaries is set in __init__.py in the (current) -directory 'Scyther'. +Get current directory (for this file) """ +def getMyDir(): + return os.path.dirname( os.path.realpath( __file__ ) ) -def setBinDir(dir): - global bindir - - bindir = dir - +""" +The default path for the binaries is the current one. +""" 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 - path = "Cache/%s/%s/" % (uid1,uid2) + # Construct: cachePath/uid1/uid2/... + path = os.path.join(getCacheDir(),uid1,uid2) name1 = "%s.out" % (uid3) name2 = "%s.err" % (uid3) - fname1 = path + name1 - fname2 = path + name2 + fname1 = os.path.join(path, name1) + fname2 = os.path.join(path, name2) try: """ diff --git a/gui/Scyther/__init__.py b/gui/Scyther/__init__.py index 4843af0..912e9f7 100644 --- a/gui/Scyther/__init__.py +++ b/gui/Scyther/__init__.py @@ -20,12 +20,3 @@ # # 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) -