dabo Commit
Revision 5242
Date: 2009-06-02 10:14:07 -0700 (Tue, 02 Jun 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5242
Changed:
U trunk/dabo/dApp.py
Log:
If symlinks are involved in the scriptDirectory or the appDirectory, the
issubdir() function would return False even if it should have been True.
Running each path through os.path.realpath() solves the issue.
Diff:
Modified: trunk/dabo/dApp.py
===================================================================
--- trunk/dabo/dApp.py 2009-06-01 15:08:55 UTC (rev 5241)
+++ trunk/dabo/dApp.py 2009-06-02 17:14:07 UTC (rev 5242)
@@ -1363,8 +1363,8 @@
calledScript = sys.argv[0]
if calledScript.startswith("./"):
calledScript = calledScript.lstrip("./")
- scriptDir = os.path.split(os.path.join(os.getcwd(),
calledScript))[0]
- appDir =
os.path.split(inspect.getabsfile(self.__class__))[0]
+ scriptDir =
os.path.realpath(os.path.split(os.path.join(os.getcwd(), calledScript))[0])
+ appDir =
os.path.realpath(os.path.split(inspect.getabsfile(self.__class__))[0])
def issubdir(d1, d2):
while True:
@@ -1385,6 +1385,7 @@
# instance of a raw dApp. So the only thing we
can really do is make the
# HomeDirectory the location of the main
script, since we can't guess at
# the application's directory structure.
+ dabo.infoLog.write("Can't deduce
HomeDirectory:setting to the script directory.")
hd = scriptDir
if os.path.split(hd)[1][-4:].lower() in (".zip",
".exe"):
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]