[Zope3-dev] would like a "package" for
registerTranslations directive
Jim Fulton
jim at zope.com
Fri Jun 25 09:39:20 EDT 2004
Stephan Richter wrote:
> On Thursday 24 June 2004 07:25, Steve Alexander wrote:
>
>>I looked at adding a 'package' attribute to the registerTranslations
>>directive, but it isn't straightforward. Specifying a package is easy:
>>I can just add a GlobalObject field to the metadirective schema.
>>However, I don't know a good way of getting this package taken into
>>account when the 'directory' attribute's Path field gets processed.
>>
>>How would I best go about writing a metadirective that has a 'directory'
>>attribute and an optional 'package' attribute, where if a relative path
>>is given for the 'directory', it would be considered relative to the
>>package?
>
>
> You want to look at the "include" directive. It is in
> zope.configuration.xmlconfig starting on line 290. There the file is simply
> treated as a bytesline instead a path, which I think is the way to go. It
> also shows you how to merge the package info and the path part.
>
> BTW, I am all for doing this enhancement.
You could just wrap the registerTranslations directive in a configure
directive and specify the package in the configure directive.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the Zope3-dev
mailing list