Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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'
def _CreateItem(name, description, indent=2):
if not description:
return name
return """{name}
{description}""".format(name=name,
description=formatting.Indent(description, indent))
def _CreateOutputSection(name, content):
return """{name}
{content}""".format(name=formatting.Bold(name),
content=formatting.Indent(content, 4))