Emmanuel Blot wrote:
http://projects.edgewall.com/trac/attachment/wiki/ChristianBoos/default_config_refactoring_and_TracIni_macro-r2979.patch
No objections for committing this?
Seems ok to me (not tested, only read).
Additionnal note: I find the syntax of the defaut parameters quite
unreadable (mostly due to the use of nested lists and string quotes)
and error prone. However, I have no suggestion about how to make it
easier to read at the moment...
Your quite right about this point: I've tried several variations,
but I'm still not happy with the result, which I find difficult
to read too...
Maybe using some kind of builder functions, to take advantage
of optional named arguments:
def section(name, *settings):
return (name, settings)
def setting(name, default_value, since="", doc=""):
return (name, default_value, doc, since)
default_config = \
(section('trac',
setting('repository_type', 'svn', since="0.10",
doc="""Repository connector type"""),
setting('repository_dir', '',
doc="""Path to local Subversion repository"""),
etc., you get the idea.
-- Christian
_______________________________________________
Trac-dev mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-dev