From: Reinhold Kainhofer Date: Fri, 11 Jun 2010 11:58:09 +0000 (+0200) Subject: Lilylib: When formatting the options help, use only one level of indentation X-Git-Tag: release/2.13.24-1~10 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6aec9cafa4d302cfb7793ea8da27592ce75b1e49;p=lilypond.git Lilylib: When formatting the options help, use only one level of indentation We tweaked the IndentedHelpFormatter to not indent the headings at all (even if we have nested groups), so it does not make sense to indent the options themselves, either. Thus, we now have either no indent or exactly indent_increment. --- diff --git a/python/lilylib.py b/python/lilylib.py index e38f69c319..9dc4f3e498 100644 --- a/python/lilylib.py +++ b/python/lilylib.py @@ -238,6 +238,17 @@ class NonDentedHeadingFormatter (optparse.IndentedHelpFormatter): " ".join (option._long_opts), metavar) + # Only use one level of indentation (even for groups and nested groups), + # since we don't indent the headeings, either + def indent(self): + self.current_indent = self.indent_increment + self.level += 1 + def dedent(self): + self.level -= 1 + if self.level <= 0: + self.current_indent = '' + self.level = 0; + def format_usage(self, usage): return _("Usage: %s") % usage + '\n'