[Zope-dev] Re: app = Zope.app() backwards incompatibility notice /
discussion
Gerry Kirk
gerry at faithonline.com
Mon Jan 26 14:51:44 EST 2004
Chris McDonough wrote:
>
> Note that FWIW, you can also do (on UNIX):
>
> zopectl run <scriptname>
>
> .. which will run a script with the name "app" set up as the root Zope
> application object. This might be the easiest way to run scripts which
> need to operate against Zope objects going forward.
>
> - C
>
I tried this, but I'm getting local variable 'app' referenced before
assignment error.
Portion of my script:
def main():
# import Zope
# Zope.configure('/home/local/plone/test2.7zope/etc/zope.conf')
# Zope.startup()
# app=Zope.app()
from Products.CMFCore.tests.base.security import
PermissiveSecurityPolicy, AnonymousUser, OmnipotentUser
_policy=PermissiveSecurityPolicy()
_oldpolicy=setSecurityPolicy(_policy)
newSecurityManager(None, OmnipotentUser().__of__(app))
- Gerry
More information about the Zope-Dev
mailing list