zope.component.zcml and global registry

Fabio Tranchitella <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
Hi folks,

the ZCML directives in zope.component register components using the utility
method handler, which looks like:

    def handler(methodName, *args, **kwargs):
        method = getattr(zope.component.getGlobalSiteManager(), methodName)

In our company-specific framework (which is far far from zope3, and only
uses the bicycle repair kit), we use different registries per application,
similarly to repoze.bfg.

Everything works, included code which relies on the zope.component's API,
thanks to the hooks on getSiteManager. Those ZCML directives use the
getGlobalSiteManager though, which is not hookable and thus we had to
reimplement the ZCML directives we need to call getSiteManager instead of
getGlobalSiteManager.

By default, getSiteManager returns the global registry, so I don't see any
obvious reason why the ZCML directives make use of getGlobalSiteManager.
repoze.bfg, for example, reimplemented the ZCML directives as we did, but
I'd love to be able to use the implementation from zope.component.

Any idea? Would you kill me if I propose to change the registration handler
to use getSiteManager instead? :)

Thanks,
Fabio
_______________________________________________
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.