ej wrote:
> it is my expectation that this code:
>
> cherrypy.config.update(
> { 'server.socket_port' : 8088,
> 'tools.staticdir.root' :
'/home/ej/proj/calibration_pages',
> }
> )
>
> appconfig = {
> '/static' : { 'tools.staticdir.on' : True,
> 'tools.staticdir.dir' : 'static',
> },
> }
>
> cherrypy.quickstart(MyFiles(), config=appconfig)
>
>
> Should give the same behavior as this code:
>
> cherrypy.config.update('static2.conf')
> cherrypy.quickstart(MyFiles())
>
> when static2.conf has this text:
>
> [global]
> server.socket_port = 8088
>
> [/static]
> tools.staticdir.on = True
> tools.staticdir.dir =
"/home/ej/proj/calibration_pages/static"
>
>
> It does not. It seems to me that something is fishy in
parsing and
> using config files. Is it also your expectation that
these would be
> equivalent, or am I misunderstanding something?
They are not equivalent, but I think you're right that they
should be.
Index: __init__.py
============================================================
=======
--- __init__.py (revision 1401)
+++ __init__.py (working copy)
 -24,6
+24,7 
def quickstart(root, script_name="",
config=None):
"""Mount the given app, start the engine
and builtin server, then
block."""
+ _local_config.update(config)
tree.mount(root, script_name, config)
server.quickstart()
engine.start()
 -253,4
+254,4 
# Set up config last so it can wrap other top-level objects
from cherrypy import _cpconfig
-config = _cpconfig.Config()
+config = _local_config = _cpconfig.Config()
Robert Brewer
System Architect
Amor Ministries
fumanchu amor.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at ht
tp://groups-beta.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---
|