How to use the fire.formatting.Indent function in fire

To help you get started, we’ve selected a few fire examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github google / python-fire / fire / helptext.py View on Github external
def _CreateAvailabilityLine(header, items,
                            header_indent=2, items_indent=25,
                            line_length=LINE_LENGTH):
  items_width = line_length - items_indent
  items_text = '\n'.join(formatting.WrappedJoin(items, width=items_width))
  indented_items_text = formatting.Indent(items_text, spaces=items_indent)
  indented_header = formatting.Indent(header, spaces=header_indent)
  return indented_header + indented_items_text[len(indented_header):] + '\n'
github google / python-fire / fire / helptext.py View on Github external
def _CreateItem(name, description, indent=2):
  if not description:
    return name
  return """{name}
{description}""".format(name=name,
                        description=formatting.Indent(description, indent))
github google / python-fire / fire / helptext.py View on Github external
def _CreateOutputSection(name, content):
  return """{name}
{content}""".format(name=formatting.Bold(name),
                    content=formatting.Indent(content, 4))