OpenQuizz
Une application de gestion des contenus pédagogiques
click.formatting Namespace Reference

Data Structures

class  HelpFormatter
 

Functions

def measure_table (rows)
 
def iter_rows (rows, col_count)
 
def wrap_text (text, width=78, initial_indent="", subsequent_indent="", preserve_paragraphs=False)
 
def join_options (options)
 

Variables

 FORCED_WIDTH = None
 

Function Documentation

◆ iter_rows()

def click.formatting.iter_rows (   rows,
  col_count 
)

◆ join_options()

def click.formatting.join_options (   options)
Given a list of option strings this joins them in the most appropriate
way and returns them in the form ``(formatted_string,
any_prefix_is_slash)`` where the second item in the tuple is a flag that
indicates if any of the option prefixes was a slash.

◆ measure_table()

def click.formatting.measure_table (   rows)

◆ wrap_text()

def click.formatting.wrap_text (   text,
  width = 78,
  initial_indent = "",
  subsequent_indent = "",
  preserve_paragraphs = False 
)
A helper function that intelligently wraps text.  By default, it
assumes that it operates on a single paragraph of text but if the
`preserve_paragraphs` parameter is provided it will intelligently
handle paragraphs (defined by two empty lines).

If paragraphs are handled, a paragraph can be prefixed with an empty
line containing the ``\\b`` character (``\\x08``) to indicate that
no rewrapping should happen in that block.

:param text: the text that should be rewrapped.
:param width: the maximum width for the text.
:param initial_indent: the initial indent that should be placed on the
                       first line as a string.
:param subsequent_indent: the indent string that should be placed on
                          each consecutive line.
:param preserve_paragraphs: if this flag is set then the wrapping will
                            intelligently handle paragraphs.

Variable Documentation

◆ FORCED_WIDTH

FORCED_WIDTH = None