[Zope-Coders] Environment variables

Tres Seaver tseaver@zope.com
29 Apr 2002 13:21:30 -0400


On Mon, 2002-04-29 at 12:47, Toby Dickenson wrote:
> On Monday 29 Apr 2002 5:29 pm, Tres Seaver wrote:
> 
> >The set that are important to Zope as a whole *need* to be "finite
> >and known in advance",
> 
> But the configuration parameters are fundamentally of variable number. For 
> example, there are options per http-server-port, or per zeo-served-storage. 

That is fine, but we still need a regularized, introspectable means
of representing those options, and the *possibility* of such options
needs to be known to the system a priori.

> > if for no other reason than documentation.
> 
> Agreed, the documentation needs to be fixed before process startup :-) A 
> registry for configuration *documentation* makes sense. Maybe thats what you 
> intended for the code you posted?

What I want is to make the available options settable from any
one of:

  - software (default values, supplied by the code which registers
    the option)

  - config file (normal means)

  - environment (temporary override, for life of "session")

  - command line (temporary override, for life of process)

I would also like to make the values introspectable, so that (for
instance) they could all be displayed on a Control_Panel plug-in,
as well as from the command line (via a command like
'bin/zopectl show').

If we use ConfigParser (as Matt is working on), then each "section"
within the config file will correspond to a "namespace" for options;
using the namespaces from the environment or the command line might
be a bit tricky;  perhaps we should marshal them using ':record'? :)

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com