Olemis Lang <olemis <at> gmail.com> writes: > This kind of problems is similar to the one mentioned in another > thread about modifying config options after executing commands. In > that case I mentioned that the same dict-like interface also holds for > WinReg and so on ... > > So thinking big (yes ! I have a big head ! ) I think that the best > approach in this case is to build an adaptation (simple) layer on top > of ConfigParser, JSON, WinReg, PyCode, YAML, ... and build specific > extensions for these formats . Perhaps the proper interfaces are > already there (e.g. `dict`, `shelve` ) and I'm just blind and looking > somewhere else ;o) Sorry, you've lost me :-) > > import copy > > self.config = copy.deepcopy(config) > > Why ? So I'm free to mutate self.config as I see fit. > extension is cool ... what's the point about adding the new method > instead of using `DictConfigurator` directly ? When you say "the new method", if you mean "configure" - the pattern is so that a subclass can override __init__ and do additional setup before configure() is called. Regards, Vinay Sajip
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4