Config interface ok

This commit is contained in:
2026-08-10 16:37:59 -03:00
parent 2777b34026
commit d087b64320
12 changed files with 4052 additions and 172 deletions
+38
View File
@@ -0,0 +1,38 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2025-2026 Renato Xavier da Silveira Rosa
# See [LICENSE](./LICENSE) or [BSD-3-Clause-Clear](https://spdx.org/licenses/BSD-3-Clause-Clear.html)
# ============================================================
# Logging
# ============================================================
import logging
import os
import re
import sys
import pprint
# Globals
logging.basicConfig(
# 50=CRITICAL/FATAL, 40=ERROR, 30=WARN/WARNING, 20=INFO, 10=DEBUG, 0=NOTSET
# loglevel_map = logging.getLevelNamesMapping()
level=logging.INFO,
format="%(asctime)s %(levelname)s %(message)s",
)
logger = logging.getLogger(__name__)
# Logging utils
def print(message):
pp = pprint.PrettyPrinter(
indent=4,
width=os.get_terminal_size().columns,
compact=False,
depth=None
)
if isinstance(message, (dict, list, tuple, set)):
formatted = pp.pformat(message)
print(formatted.replace("', '", "',\n'"))
else:
pp.pprint(message)