[Zope-dev] Accessing root object

Tres Seaver tseaver@palladion.com
Thu, 10 Feb 2000 17:57:37 -0600


Robert Sander <zope-dev@beteigeuze.cs.tu-berlin.de> wrote:

> On Thu, Feb 10, 2000 at 03:40:38PM -0000, Phil Harris wrote:
> > I think there's something  called app?
> >
> > It's declared in <zopedir>/lib/python/Main.py.
> >
> > That may be what your looking for??
> 
> I don't know, the object app is not in the global namespace when __init__.py
> of my Product is called.
> 
> It may be the same problem with the discussed scheduler product when creating
> another thread, b ut I don't know.

Here is a snippet from the ZopeStudio product, which munges the top-level
application object (actually, its *class*) to add the RDF stuff that the Mozilla
front end uses::

 # Shove the above method in the Application class
 OFS.Application.Application.zsTreeRoot = zsTreeRoot

You should be able to do the same::

 OFS.Application.Application.theORB = CORBA.orb_init( sys.argv ) # or whatever

-- 
=========================================================
Tres Seaver         tseaver@palladion.com    713-523-6582
Palladion Software  http://www.palladion.com