[Twisted-Python] Configuration: The Never Ending Story.

Chris Armstrong carmstro at dynup.net
Sat May 12 02:10:53 EDT 2001

On Fri, May 11, 2001 at 07:49:17PM +0300, Moshe Zadka wrote:
> On Fri, 11 May 2001 19:36:24 +0300, Chris Armstrong <carmstro at dynup.net> wrote:
> > name change: setParamaters()
> setParameter() sans the 's'. One call per parameter

yes, that was a typo, I do know that there will be one call per parameter

> > goes completely haywire while configuring. (For instance, what if we're
> > configuring a web server through the web interface?)
> That's the classical example for why it's needed. Since the UI should
> do something like that
> for parameter in stuff_i_got:
>     object.setParameter(...)
> object.endParameters()
> Then everything is fine.
> That's a classical case of "if there's a doubt, there isn't a doubt": if the
> UI is *not* sure it won't call other methods, it *should* call .endParameters()
> It is *not* promised that there won't be multiple batches -- that's a QoI
> issue.

Alright, I think I just misunderstood what you said about not executing
methods until endParameters() is called. I thought you meant the object
should be non-functional until endParamaters() is called. i realize now
how stupid of a thought that was. :)

> > instantiates the object (well, it'll have to be klass.__dict__['getInitArgs'](),
> > as glyph pointed out to me). 
> No, we won't.
> We'll have copy.copy(klass.initParameters). No need to make it a callable,
> really.

Why? I don't understand. (I should make this [TM])

> > > class ArrayQuestion: (an array of the same kind of question)
> > 
> > moshe told me this was a thinko, so forget about array of questions :)
> I misunderstood radix. Let me clarify:
> It's something like if you want to have a set of Servers in a selector:
> ArrayParameter(InterfaceParameter(ServerInterface))

Uhh.. isn't that what ListParameter is for?

> Python will not have *any* implementation of interface checking stuff.
> Of course, we'll just take objects up on their __implements__ word,
> not check through methods.

Ok, I was thinking of PEP 0246.

> > > * How do we allow the object to signify groupings of questions?
> > >   Suggestion: this means the design is bad -- break down the object
> > >   into smaller objects
> >
> > I'm not sure of my stance on this. I'll try to think of some examples and
> > discuss.
> I myself have misgivings on that. But maybe we can punt on it for now?

The only advantage I see of mutliple question sections (outside of one set
for instantiation and one for configuration) is a wizard-like interface,
and I'm not so sure that's good anyway. :)

Chris Armstrong                        carmstro at twistedmatrix.com
http://twistedmatrix.com/~carmstro     carmstro at dynup.net

More information about the Twisted-Python mailing list