[Dev] CHANDLERHOME and directory layout (was Re: Unit test runner)
Andi Vajda
vajda at osafoundation.org
Fri Feb 4 17:38:52 PST 2005
Removing one more thing from Globals is great !
The repository code does not use CHANDLERHOME other than in unit tests, feel
free to place fileNearModule() wherever you think is right.
Andi..
On Fri, 4 Feb 2005, Phillip J. Eby wrote:
> 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.
>
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> Open Source Applications Foundation "Dev" mailing list
> http://lists.osafoundation.org/mailman/listinfo/dev
>
More information about the Dev
mailing list