« Return to Thread: setting up local utilities from outside grok

setting up local utilities from outside grok

by Jasper Spaans-4 :: Rate this Message:

Reply to Author | View in Thread

Hi list,

I've got a small issue with setting up local utilities on a
grok.Application; I have something like the following:

class MyWonderfulApp(grok.Application):
    grok.local_utility(PluggableAuthentication, provides=IAuthentication,
                       setup=setup_authentication)

This works fine if I instantiate my application through the webinterface.
However, I'd like to be able to instantiate my application using some code
(which doesn't know a lot about grok), where I do something like:


grok.grok('my.app')
root = get_apps_root()  # this sets up the ZODB connection and returns the
                        # root object

if 'test' not in root:
    root['test'] = app = MyWonderfulApp(...)
    ...
    transaction.commit()

The application is available, I can access views, but no sitemanager or
localutil is registered, and my authentication thing is not set up.

Is there an easy way to get this to work?

Cheers,
--
Jasper Spaans

Fox-IT Experts in IT Security!
I www.fox-it.com
_______________________________________________
Grok-dev mailing list
Grok-dev@...
http://mail.zope.org/mailman/listinfo/grok-dev

 « Return to Thread: setting up local utilities from outside grok