Hi all,
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).
My app uses an SQLite database. During server startup, I
must check
that the db file exists on the path specified in the config
file (if it
isn't there, sqlite simply creates a new db and I won't
know anything
is wrong until db lookups fail). I do this by calling a
preflight
function that raises an exception if the db cannot be found.
Now, as the db path is stored in the config file, I have to
parse it
first, then run preflight and proceed accordingly. When
cherrypy starts
up, it to parses the same conf file. This works of course,
but it seems
very inelegant.
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?
--~--~---------~--~----~------------~-------~--~----~
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 http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---
|