zabgrab.ui.listing¶
Laying out listings of data points (zabgrab show) as lines of text.
Listings can be long, so they’re plain aligned columns rather than rich tables: quick to produce, and readable in a pager, a pipe or a file.
Module Attributes
|
|
What newlines in a text value become when it's kept to one line. |
|
Space between columns. |
Functions
|
Lay out bin counts: a section per item, with a line per bin. |
|
Name a series' item, with its units and resolution if it has them. |
|
Lay out a listing. |
- zabgrab.ui.listing.Line¶
"","bold"or"dim".- Type:
A line of output and its style
- zabgrab.ui.listing.NEWLINE = ' ⏎ '¶
What newlines in a text value become when it’s kept to one line.
- zabgrab.ui.listing.GAP = ' '¶
Space between columns.
- zabgrab.ui.listing.label(series)[source]¶
Name a series’ item, with its units and resolution if it has them.
- zabgrab.ui.listing.listing_lines(sections, tz, *, headings, offset=0, wrap=False)[source]¶
Lay out a listing.
- Parameters:
sections (sequence of Section) – The listing (see
zabgrab.services.listing.listing()).tz (tzinfo or None) – The time zone to show times in (
Nonefor local time).headings (bool) – Head each section with its item and how many of its points are shown (for listings with a section per item).
offset (int, optional) – How many points were skipped at the start of each section, for the headings’ counts.
wrap (bool, optional) – Show text values in full, over several lines, rather than on one line with
⏎for each line break.
- Returns:
list of Line – The lines, without line breaks, and how to style each.
- Return type: