[Twisted-Python] Accessing app-wide data in Woven

Christopher Armstrong radix at twistedmatrix.com
Fri Jul 18 13:16:20 EDT 2003

On Fri, Jul 18, 2003 at 04:44:22PM +0000, mesozoic wrote:
> I am writing a Woven app that I would like to make fairly configurable by
> the end-user without asking them to change my code. The way I'm doing this
> now is with a special class, SiteConfiguration, that is given various data
> in the root-level .rpy.
>  cfg = SiteConfiguration(...)
>  registry.setComponent(SiteConfiguration, cfg)

I wouldn't even use the registry at all; you can just give the
resource you create in that .rpy access to the SiteConfiguration
instance, and it can do whatever it wants with it.

 Twisted | Christopher Armstrong: International Man of Twistery
  Radix  |          Release Manager,  Twisted Project
---------+     http://twistedmatrix.com/users/radix.twistd/

More information about the Twisted-Python mailing list