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

Moshe Zadka m at moshez.org
Fri Jul 18 13:35:37 EDT 2003


On Fri, 18 Jul 2003, Christopher Armstrong <radix at twistedmatrix.com> wrote:

> 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.

Including giving it to its children, in some way or another...
[Possibilities are endless, from overriding putChild to overriding
getChildWithDefault -- since we have no idea how the rest of
your code looks like, its hard to make any specific replies...]
-- 
Moshe Zadka -- http://moshez.org/
Buffy: I don't like you hanging out with someone that... short.
Riley: Yeah, a lot of young people nowadays are experimenting with shortness.
Agile Programming Language -- http://www.python.org/




More information about the Twisted-Python mailing list