summaryrefslogtreecommitdiff
path: root/py_include/homekit/inverter/util.py
blob: a577e6a7071a3a6d5be7c55759b35dc193ba327d (plain)
1
2
3
4
5
6
7
8
import re


def beautify_table(s):
    lines = s.split('\n')
    lines = list(map(lambda line: re.sub(r'\s+', ' ', line), lines))
    lines = list(map(lambda line: re.sub(r'(.*?): (.*)', r'<b>\1:</b> \2', line), lines))
    return '\n'.join(lines)