pattern_clustering.html.RowFormatter

class RowFormatter(pmap_color: Optional[ReadPropertyMap] = None, fmt_row: str = '%3s')[source]

Bases: object

Functor used to format row (line number) of a file.

Constructor.

Parameters
  • pmap_color (ReadPropertyMap) – A ReadPropertyMap{int : str} mapping a row with its corresponding color.

  • fmt_row (str) – Format string used to display the row.

Methods

__call__(row: int, line: str) str[source]

Callback operator.

Parameters
  • row (int) – The line number of the row being processed.

  • line (str) – The current line content.

Returns

The corresponding HTML row label.