Re: Blueprint: zope.generations

Michael Howitz <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
Am 23.08.2010 um 15:52 schrieb Jim Fulton:
> On Mon, Aug 23, 2010 at 3:41 AM, Michael Howitz <[email protected]> wrote:
[...]
>> The "database opened" event from zope.processlifetime is already used, zope.app.publication is needed for this function in zope.app.generations.utility:
>> 
>> def getRootFolder(context):
>>    return context.connection.root().get(
>>        zope.app.publication.zopepublication.ZopePublication.root_name, None)
>> 
>> I think this function is needed in every generation script.
> 
> Hm, this depends on a particular application (as defined by zope.app).
> 
>> Is there another way to get the root folder?
> 
> Some apps probably don't use a root folder.

But most apps do so, I think. I moved the getRootFolder function to zope.app.generations from zope.app.zopeappgenerations some months ago as it was the only reason I needed the zope.app.zopeappgenerations package.

What about a condition? Only when zope.app.publication is available, the function gets defined. So we could get rid of it as a dependency and do not need a separate package for this function.


>> Should the root_name be hard coded here instead of importing it?
> 
> I think this is an issue for the individual zope.generations plug ins.
> Does zope.generations itself use this?

No it does not use it itself.


Yours sincerely,
-- 
Michael Howitz · [email protected] · software developer
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development

_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.