On Sun, 29 Jan 2012 04:57:25 -0600
"Edward K. Ream" <[email protected]> wrote:
> Terry, you might try messing with c.hash to see if changing it makes a
> difference. In particular, you might trace the result returned in the
> various scenarios that have been giving you troubles.
cd /home/tbrown/Package/leo/bzr/leo.repo/trunk
python launchLeo.py ~/.leo/del.leo
@settings in del.leo ignored, c.hash() = "/home/tbrown/.leo/del.leo"
cd /home/tbrown/.leo
python /home/tbrown/Package/leo/bzr/leo.repo/trunk/launchLeo.py del.leo
@settings in del.leo honored, c.hash() =
"/mnt/usr1/usr1/home/tbrown/.leo/del.leo"
So, I can see why Leo uses the path to the Leo file to identify its
settings, but at the same time @setting in a particular file should be
honored.
The problem is that os.getcwd() and friends use the POSIX C getcwd()
function (whatever it's called), and POSIX says return the absolute
path.
os.path.abspath(path) === os.path.normpath(join(os.getcwd(), path))
Where to fix it? I'd prefer it use /home/tbrown so settings follow me
around more, at home /home/tbrown may be /mnt/usr1/usr1/home/tbrown,
whereas at work /home/tbrown may be /media/raid2TB/home/tbrown.
So, c.hash() could operate on os.path.abspath(path), simplest, and
probably fixes the ignored @settings problem.
Or c.hash() could be calculated from
os.path.normpath(join(os.getenv('PWD'), path))
http://stackoverflow.com/questions/1542803/is-there-a-version-of-os-getcwd-that-doesnt-dereference-symlinks
At least it explains what's going on.
Cheers -Terry
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.