[PEAK] config.fileNearModule() in peak.ini
Phillip J. Eby
pje at telecommunity.com
Wed Apr 20 12:09:55 EDT 2005
At 03:44 PM 04/20/2005 +0300, Yaroslav Samchuk wrote:
>Hi,
>
>In http://www.eby-sarna.com/pipermail/peak/2004-October/001816.html you
>told, that `config.fileNearModule` is depricated and `config.packageFile`
>should be used instead.
>
>Yesterday I tried to execute application, which uses `peak.web` and is
>distributed using py2exe. And noticed, that there were some problems
>zip-importing `peak.web/resource_defaults.ini`. After some examation I had
>found, that peak.ini contains the next lines:
>======
>[peak.web]
>resourceDefaultsIni = config.packageFile('peak.web','resource_defaults.ini')
>
>[peak.running.shortcuts]
>version-config =
> commands.Alias(
> targetObj,
> command = [
> 'runIni',
> config.fileNearModule('peak.tools.version','version.ini')
> ]
> )
>======
>
>Is it OK with these two `config.fileNearModule` calls, or it should be
>changed to `config.packageFile`?
Actually, they should probably just be changed to
'pkgfile:peak.web/resource' and the equivalent for
version-config. However, there is a bug in the 'runIni' command, in that
it absolutely requires a filename. This isn't fixable right away, because
it's going to need to use the pkg_resources module (part of the "Python
Eggs") runtime in order to get around this.
Anyway, changing the first one above to a 'pkgfile:' URL works, but the
latter won't until pkg_resources is available.
More information about the PEAK
mailing list