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