[Dev] CHANDLERHOME and directory layout (was Re: Unit test runner)
Phillip J. Eby
pje at telecommunity.com
Fri Feb 4 17:33:18 PST 2005
At 08:12 PM 2/4/05 -0500, Phillip J. Eby wrote:
>But anyway, I'm getting ahead of myself here. For right now, I'm
>proposing to add a 'fileNearModule' function, and to use it to replace all
>of the 'CHANDLERHOME' and 'chandlerDirectory' uses that are looking for a
>filename near a module. For any remaining uses of CHANDLERHOME, I propose
>making it default to '.', which would make it default to the current directory.
I just realized I missed something here. 'Chandler.py' lives in
CHANDLERHOME, so that means that this:
import Chandler
parcelDir = fileNearModule(Chandler, "parcels")
can be used to find the current location of the parcel directory, and:
logFile = fileNearModule(Chandler, "chandler.log")
can be used to set the logfile location for tests. The Chandler module
itself can also use its own __file__ setting to determine the
chandlerDirectory, rather than needing to import 'application' and go up
from there, as it currently does.
So, it would appear that Globals.chandlerDirectory could perhaps go away
altogether.
More information about the Dev
mailing list