mirror of
https://github.com/dw-0/kiauh.git
synced 2026-01-02 04:33:35 +05:00
refactor: improve error logging on missing kiauh config file
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
@@ -212,15 +212,14 @@ class KiauhSettings:
|
||||
)
|
||||
|
||||
def _kill(self) -> None:
|
||||
l1 = "!!! ERROR !!!"
|
||||
l2 = "No KIAUH configuration file found!"
|
||||
error = textwrap.dedent(
|
||||
f"""
|
||||
{COLOR_RED}/=======================================================\\
|
||||
| {l1:^53} |
|
||||
| {l2:^53} |
|
||||
\=======================================================/{RESET_FORMAT}
|
||||
"""
|
||||
)[1:]
|
||||
print(error, end="")
|
||||
Logger.print_dialog(
|
||||
DialogType.ERROR,
|
||||
[
|
||||
"No KIAUH configuration file found! Please make sure you have at least "
|
||||
"one of the following configuration files in KIAUH's root directory:",
|
||||
"● default.kiauh.cfg",
|
||||
"● kiauh.cfg",
|
||||
],
|
||||
end="",
|
||||
)
|
||||
kill()
|
||||
|
||||
@@ -120,15 +120,19 @@ class Logger:
|
||||
|
||||
@staticmethod
|
||||
def _format_top_border(color: str) -> str:
|
||||
return textwrap.dedent(f"""
|
||||
return textwrap.dedent(
|
||||
f"""
|
||||
{color}┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||
""")[:-1]
|
||||
"""
|
||||
)[1:-1]
|
||||
|
||||
@staticmethod
|
||||
def _format_bottom_border() -> str:
|
||||
return textwrap.dedent(f"""
|
||||
return textwrap.dedent(
|
||||
f"""
|
||||
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||
{RESET_FORMAT}""")
|
||||
{RESET_FORMAT}"""
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def _format_dialog_title(title: str) -> str:
|
||||
|
||||
Reference in New Issue
Block a user