[Zope] How can I "from __future__ import nested_scopes" in python scripts?

jelle jellej@pacbell.net
Tue, 26 Jun 2001 10:42:36 -0700 (PDT)


Hi Brian,

I tried your suggestion by adding the "from __future__ import
nested_scopes" statement to a database adapter product that I'm
currently using.

There doesn't seem to be a change with nested scope failure when I
restarted Zope.

Perhaps I mis-understood your instructions. Do I need a dedicated product
specifically for nested scopes or a product for my script or will the
"__future__" import in any product activate the behaviour. The last option
doesn't seem to work with the sample script code in the previous post.

Thanks
Jelle

On Tue, 26 Jun 2001, Brian Lloyd wrote:

> > I'm using Zope2.4 beta with Python 2.1 and I want to use the nest_scope
> > functionality. However when I add the prerequisite statement:
> >
> > from __future__ import nested_scopes
> >
> > at the top of my python script it gives me an "ImportError" and
> > "unauthorized" message.
> >
> > By default the nested scopes are not included.
> >
> > How do I this work?
>
> One approach would be to create a Python "product". In
> lib/python/Products create a new directory with a single
> __init__.py file containing only:
>
> from __future__ import nested_scopes
>
> After restarting, nested scopes should be enabled.
>
> Hope this helps!
>
>
> Brian Lloyd        brian@digicool.com
> Software Engineer  540.371.6909
> Digital Creations  http://www.digicool.com
>
>

--