What INI config file module allows lists of duplicate same-named options?

Thomas L. Shinnick tshinnic at io.com
Sun Jan 9 16:04:07 EST 2011


At 02:47 PM 1/9/2011, Corey Richardson wrote:
>On 01/09/2011 03:43 PM, Thomas L. Shinnick wrote:
> > Having (possibly) surveyed all the available pypi config file modules, I
> > still haven't seen one that allows an obvious and familiar extension of
> > the strict Windows INI format.
> >
> > Each INI-style config module seems to enforce the strict rule: each
> > option in a section must have a different name - no duplicates.  Thus it
> > is impossible to have a simple list, e.g.
> >
> >     [pathset  uk]
> >     pathpair: /bath/*                         to    /london/*
> >     pathpair: /bath/upload/**                 to    /london/*
> >     pathpair: /firth/*                        to    /forth/*
> >     pathpair: /firth/upload/**                to    /forth/*
> >
> > Rather you must give each line a separate name, e.g.
> >
> >     [pathset  uk]
> >     pathpair001: /bath/*                      to    /london/*
> >     pathpair002: /bath/upload/**              to    /london/*
> >     pathpair003: /firth/*                     to    /forth/*
> >     pathpair004: /firth/upload/**             to    /forth/*
> >           |       |      |       |      |       |
> >     pathpair068: /glasgow/*                   to    /edinburgh/*
> >     pathpair069: /glasgow/upload/**           to    /edinburgh/*
> >           |       |      |       |      |       |
> >
> > This is not ideal for a number of reasons.  Do you know of a library
> > module that has the (optional?) ability to handle duplicate-named
> > options, returning them as a list?
> >
> > If instead someone can point me to a reasonable Apache-style config
> > module, that might also serve.  I've looked for such and the few found
> > seemed to be either bare bones or clumsily stripped out of something
> > much larger.
> >
> >
> > --
> > I'm a pessimist about probabilities; I'm an optimist about possibilities.
> >     Lewis Mumford  (1895-1990)
> >
>
>Seems to me to be a standard enforced by Windows itself, not any an
>issue with the modules. What exactly are you doing?

Windows established the format, established the 'rules', then people 
adopted the format and rules, but often with 'adaptions' and 
extensions.  I see many variations in the various modules found in 
pypi, such as variable interpolation, but none that violate the 
'rule' "no duplicates".

Here, I need to list multiple file/dir path pairs.  A list of 
multiple items to be acted upon in a common way.  It is a 
list.  Simple.  Except I can't find a library/pypi module with the 
obvious extension.

Full disclosure: I'm familiar with $lang which has many such possible 
modules, which has me rather puzzled here.

>~Corey Richardson




More information about the Python-list mailing list