mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-24 16:23:36 +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:
|
def _kill(self) -> None:
|
||||||
l1 = "!!! ERROR !!!"
|
Logger.print_dialog(
|
||||||
l2 = "No KIAUH configuration file found!"
|
DialogType.ERROR,
|
||||||
error = textwrap.dedent(
|
[
|
||||||
f"""
|
"No KIAUH configuration file found! Please make sure you have at least "
|
||||||
{COLOR_RED}/=======================================================\\
|
"one of the following configuration files in KIAUH's root directory:",
|
||||||
| {l1:^53} |
|
"● default.kiauh.cfg",
|
||||||
| {l2:^53} |
|
"● kiauh.cfg",
|
||||||
\=======================================================/{RESET_FORMAT}
|
],
|
||||||
"""
|
end="",
|
||||||
)[1:]
|
)
|
||||||
print(error, end="")
|
|
||||||
kill()
|
kill()
|
||||||
|
|||||||
@@ -120,15 +120,19 @@ class Logger:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _format_top_border(color: str) -> str:
|
def _format_top_border(color: str) -> str:
|
||||||
return textwrap.dedent(f"""
|
return textwrap.dedent(
|
||||||
|
f"""
|
||||||
{color}┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
{color}┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
||||||
""")[:-1]
|
"""
|
||||||
|
)[1:-1]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _format_bottom_border() -> str:
|
def _format_bottom_border() -> str:
|
||||||
return textwrap.dedent(f"""
|
return textwrap.dedent(
|
||||||
|
f"""
|
||||||
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||||
{RESET_FORMAT}""")
|
{RESET_FORMAT}"""
|
||||||
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _format_dialog_title(title: str) -> str:
|
def _format_dialog_title(title: str) -> str:
|
||||||
|
|||||||
Reference in New Issue
Block a user