ui.formatting
ui.formatting
Value normalization and formatting helpers for the UI.
Provide small utility functions used when rendering values in the TapMap interface.
safe_str(value)
Return empty string for None, otherwise str(value).
Source code in ui/formatting.py
12 13 14 | |
safe_int(value, default=-1)
Convert value to int, or return default on failure.
Source code in ui/formatting.py
17 18 19 20 21 22 | |
scope_rank(scope)
Return sort rank for scope values.
Source code in ui/formatting.py
25 26 27 28 | |
port_from_local(addr)
Extract port from an 'ip:port' string.
Source code in ui/formatting.py
31 32 33 34 35 36 | |
strip_port(addr)
Remove trailing ':port' from an address string.
Source code in ui/formatting.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
pretty_bind_ip(ip)
Map wildcard bind addresses to readable labels.
Source code in ui/formatting.py
56 57 58 59 60 61 62 | |