From: Peter H. <pe...@en...> - 2006-04-08 11:53:31
|
Rob Cowie wrote: > I currently use the configfile.conf to store not only cherrypy > settings, but several application specific parameters as well. Things > such as alternative paths to required third-party modules (to allow > users to override the default and store things wherever they like). ... > How would you use the .conf file in this situation? > > Would you parse it once, then allow cherrypy to parse it again as > required? or would you parse it, store the values and pass them to > cherrypy as a dict at startup? I wouldn't couple those two things together in my design. Keep the cherrypy config file for cherrypy, and make a new config file for yourself. Then you won't have that uneasy feeling that what you are doing is inelegant... Among other benefits, this way you know that if a future version of cherrypy starts looking for a section with the same name as one you've chosen to use for yourself, nothing mysteriously bad will happen... -Peter |