Mercurial > public > src > moin > 1.9
diff MoinMoin/config/multiconfig.py @ 3763:0284379adbc8
some config refactorings, add WikiConfig macro
The WikiConfig macro shows all wiki settings that have non-default values;
it is restricted to superusers.
author | Johannes Berg <johannes AT sipsolutions DOT net> |
---|---|
date | Sun, 22 Jun 2008 10:46:18 +0200 |
parents | 24e9fecdd81c |
children | 6a618481be28 |
line wrap: on
line diff
--- a/MoinMoin/config/multiconfig.py Sun Jun 22 02:51:15 2008 +0200 +++ b/MoinMoin/config/multiconfig.py Sun Jun 22 10:46:18 2008 +0200 @@ -202,14 +202,25 @@ """ just a container for stuff we cache """ pass +class ConfigFunctionality(object): + """ Configuration base class with config class behaviour. -class DefaultConfig(object): - """ Configuration base class with default config values - (added below) + This class contains the functionality for the DefaultConfig + class for the benefit of the WikiConfig macro. """ - def __init__(self, siteid): """ Init Config instance """ + # keep first! + settings = {} + for k in self.__dict__: + settings[k] = True + + # will be assigned in by loader code (see above, _makeConfig) + self.cfg_mtime = None + + # will be lazily loaded by interwiki code when needed (?) + self.shared_intermap_files = None + self.siteid = siteid self.cache = CacheClass() @@ -350,6 +361,13 @@ if self.url_prefix_local is None: self.url_prefix_local = self.url_prefix_static + # keep last!! + self.computed_settings = {} + for k in self.__dict__: + if k in settings: + continue + self.computed_settings[k] = True + def load_meta_dict(self): """ The meta_dict contains meta data about the wiki instance. """ @@ -564,6 +582,14 @@ """ Make it possible to access a config object like a dict """ return getattr(self, item) +class DefaultConfig(ConfigFunctionality): + """ Configuration base class with default config values + (added below) + """ + # Do not add anything into this class. Functionality must + # be added above to avoid having the methods show up in + # the WikiConfig macro. Settings must be added below to + # the options dictionary. def _default_password_checker(request, username, password): """ Check if a password is secure enough.