Config Formatters

Here belong tools for configuration fomatting purposes.

uwsgiconf.formatters.format_print_text(text: str, *, color_fg: str = None, color_bg: str = None) → str

Format given text using ANSI formatting escape sequences.

Could be useful for print command.

  • text
  • color_fg – text (foreground) color
  • color_bg – text (background) color
class uwsgiconf.formatters.FormatterBase(sections: List[Section])

Base class for configuration formatters.

iter_options() → Generator[Tuple[str, str, Any], None, None]

Iterates configuration sections groups options.

class uwsgiconf.formatters.IniFormatter(sections: List[Section])

Translates a configuration as INI file.

class uwsgiconf.formatters.ArgsFormatter(sections: List[Section])

Translates a configuration to command line arguments.

uwsgiconf.formatters.FORMATTERS = {'args': <class 'uwsgiconf.formatters.ArgsFormatter'>, 'ini': <class 'uwsgiconf.formatters.IniFormatter'>}

Available formatters by alias.