Hi Mike,

cherrypy.config.update() doesn't work with the new config files
(because they're no longer INI format files. (From the def
configure(), that would seem to imply that these are last week's
format as opposed to this week's format... which should still work,
but it's not as pretty.)

You want to use turbogears.update_config:

update_config(configfile=None, modulename=None)
    Updates the system configuration either from a Python
    config file, a module name specified in dotted notation or
    both. If both are specified, the module
    is called first, followed by the config file.

    These modules define a PathConfig compatible file. That is,
    they should either be INI-esque or provide a configure
    function.

Generally, you'll call it like this:

turbogears.update_config(configfile="abs/path/to/prodcfg.py",
modulename="yourpackage.config")

Kevin

On 1/16/06, Mike Sarahan <[EMAIL PROTECTED]> wrote:
> file: /home/mikez0r/elementarycatastrophe.com/devcfg.py, line: 6
> 'def configure():\n'
> Traceback (most recent call last):
>   File "tg_fastcgi.fcgi", line 21, in ?
>     class VirtualPathFilter(object):
>   File "tg_fastcgi.fcgi", line 74, in VirtualPathFilter
>     tg_init()
>   File "tg_fastcgi.fcgi", line 58, in tg_init
>     cherrypy.config.update(file=join(code_dir,"devcfg.py"))
>   File
> "/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta
> -py2.4.egg/cherrypy/config.py", line 71, in update
>     updateMap.update(dict_from_config_file(file))
>   File
> "/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta
> -py2.4.egg/cherrypy/config.py", line 221, in dict_from_config_file
>     configParser.read(configFile)
>   File
> "/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta
> -py2.4.egg/cherrypy/config.py", line 209, in read
>     self._read(fp, filename)
>   File "/home/mikez0r/lib/lib/python2.4/ConfigParser.py", line 462, in
> _read
>     raise MissingSectionHeaderError(fpname, lineno, line)
> ConfigParser.MissingSectionHeaderError: File contains no section
> headers.
> file: /home/mikez0r/elementarycatastrophe.com/devcfg.py, line: 6
> 'def configure():\n'
> (END)

Reply via email to