Skip to content

Commit 2c84dbf

Browse files
committed
docs(base): document ASCII delimiter choice in get_table()
1 parent c343644 commit 2c84dbf

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2424
* base.py: `get_perfdata()` now sanitizes labels by stripping single quotes and replacing `=` with `_`
2525
* base.py: deduplicate `get_state()` operator logic using `operator` module
2626
* base.py: deduplicate `sum_dict()` by delegating to `sum_lod()`
27+
* base.py: `get_table()`: document why pure ASCII delimiters are used instead of Unicode box-drawing characters
2728
* base.py: improve `get_table()` performance for large tables
2829
* base.py: move `parse_range()` and state name mapping to module level
2930
* base.py: remove unused `collections` import

base.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"""
1313

1414
__author__ = 'Linuxfabrik GmbH, Zurich/Switzerland'
15-
__version__ = '2026032101'
15+
__version__ = '2026040801'
1616

1717
import numbers
1818
import operator
@@ -219,7 +219,11 @@ def get_state(value, warn, crit, _operator='ge'):
219219

220220
def get_table(data, cols, header=None, strip=True, sort_by_key=None, sort_order_reverse=False):
221221
"""
222-
Format a list of dictionaries into a simple ASCII table (generator version).
222+
Format a list of dictionaries into a simple ASCII table.
223+
224+
Uses pure ASCII delimiters (`!`, `+`, `-`) instead of Unicode box-drawing characters
225+
(like `│`, `┼`, `─`) to guarantee correct rendering on any platform, locale, terminal,
226+
and transport layer regardless of encoding.
223227
224228
Each dictionary must contain the specified columns (`cols`). Optionally supports a custom
225229
header, sorting by a given key, and stripping whitespace from values.

0 commit comments

Comments
 (0)