@classmethod<EOL><INDENT>def class_config_section(cls):<DEDENT>
def c(s):<EOL><INDENT>"""<STR_LIT>"""<EOL>s = '<STR_LIT>'.join(wrap_paragraphs(s, <NUM_LIT>))<EOL>return '<STR_LIT>' + s.replace('<STR_LIT:\n>', '<STR_LIT>')<EOL><DEDENT>breaker = '<STR_LIT:#>' + '<STR_LIT:->'*<NUM_LIT><EOL>s = "<STR_LIT>"%cls.__name__<EOL>lines = [breaker, s, breaker, '<STR_LIT>']<EOL>desc = cls.class_traits().get('<STR_LIT:description>')<EOL>if desc:<EOL><INDENT>desc = desc.default_value<EOL><DEDENT>else:<EOL><INDENT>desc = getattr(cls, '<STR_LIT>', '<STR_LIT>')<EOL><DEDENT>if desc:<EOL><INDENT>lines.append(c(desc))<EOL>lines.append('<STR_LIT>')<EOL><DEDENT>parents = []<EOL>for parent in cls.mro():<EOL><INDENT>if parent is not cls and issubclass(parent, Configurable) andparent.class_traits(config=True):<EOL><INDENT>parents.append(parent)<EOL><DEDENT><DEDENT>if parents:<EOL><INDENT>pstr = '<STR_LIT:U+002CU+0020>'.join([ p.__name__ for p in parents ])<EOL>lines.append(c('<STR_LIT>'%(cls.__name__, pstr)))<EOL>lines.append('<STR_LIT>')<EOL><DEDENT>for name,trait in cls.class_traits(config=True).items():<EOL><INDENT>help = trait.get_metadata('<STR_LIT>') or '<STR_LIT>'<EOL>lines.append(c(help))<EOL>lines.append('<STR_LIT>'%(cls.__name__, name, trait.get_default_value()))<EOL>lines.append('<STR_LIT>')<EOL><DEDENT>return '<STR_LIT:\n>'.join(lines)<EOL>
Get the config class config section