[Featureserver] Including configuration bits

Yves Moisan yves.moisan at boreal-is.com
Fri Sep 17 16:52:20 EDT 2010


  Le 2010-09-17 14:11, Yves Moisan a écrit :
>  HI All,
>
> I'm looking in the ConfigParser docs for info as to the possibility of 
> including bits from another .cfg file, as in (pseudo-code) :
>
> dsn="my-dsn.cfg"
>
> The idea is that I'd like to factor out things like the dsn into 
> another file and just include it in my various layers.
>
> Is that possible ?
I did some tests with cfgparse 
(http://cfgparse.sourceforge.net/cfgparse-adding-options.html) and it 
can import configuration bits from the default featureserver.cfg file :

 >>> c = cfgparse.ConfigParser()
 >>> c.add_option('type',keys='scribble')
<Option at 0x2d65d70: type>
 >>> c.add_file('featureserver.cfg')
<ConfigFileIni at 0x2d65e70: C:\Python25\featureserver.cfg>
 >>> opts = c.parse()
 >>> print opts.type
DBM

It can also include bits from another file featureserver.cfg files 
AFAICT from the docs.  Of course that would mean modifying server.py and 
downloading an extra egg (cfgparse).

Anyone interested in this ?

Cheers,

Yves



More information about the Featureserver mailing list