Re: Proposal: Logging system rewrite
Steven Armstrong <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.devel |
|---|---|
| Message-ID | <[email protected]> |
> Problems > -------- > > How does the tools modules get access to the config dict? > As everybody seems to be +1 on this, what do you think about the above problem? What I currently do is the following: I've created two functions in tools, namely: tools.py ---------- _config = None def initialize(conf): global _config _config = conf def cleanup(): "close logfiles and do other cleanup stuff" ------------------- I then call tools.initialize(config) from Pyblosxom.initialize. tools.cleanup() is called from a new method I've created, Pyblosxom.cleanup. Pyblosxom.cleanup is called at the end of the Pyblosxom.run* methods. It seems to work nicely. Any other/better ideas how to solve this? cheers Steven ------------------------------------------------------- This SF.net email is sponsored by Demarc: A global provider of Threat Management Solutions. Download our HomeAdmin security software for free today! http://www.demarc.com/Info/Sentarus/hamr30