Skip to content

Commit

Permalink
cleanup msg.logos_error
Browse files Browse the repository at this point in the history
  • Loading branch information
n8marti authored and thw26 committed Aug 23, 2024
1 parent 1af1592 commit 7967170
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions msg.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import config
from gui import ask_question
from gui import show_error
import utils

logging.console_log = []

Expand Down Expand Up @@ -145,10 +144,10 @@ def logos_warn(message):
logos_msg(message)


#TODO: I think detail is doing the same thing as secondary.
# TODO: I think detail is doing the same thing as secondary.
def logos_error(message, secondary=None, detail=None, app=None, parent=None):
if detail is None:
message = f"{message}\n{detail}"
detail = ''
logging.critical(message)
WIKI_LINK = "https://github.com/FaithLife-Community/LogosLinuxInstaller/wiki" # noqa: E501
TELEGRAM_LINK = "https://t.me/linux_logos"
Expand All @@ -157,15 +156,16 @@ def logos_error(message, secondary=None, detail=None, app=None, parent=None):
if config.DIALOG == 'tk':
show_error(
message,
detail=f"{detail}\n{help_message}",
detail=f"{detail}\n\n{help_message}",
app=app,
parent=parent
)
elif config.DIALOG == 'curses' and secondary != "info":
status(message)
status(help_message)
elif secondary != "info":
logos_msg(message)
elif config.DIALOG == 'curses':
if secondary != "info":
status(message)
status(help_message)
else:
logos_msg(message)
else:
logos_msg(message)

Expand Down Expand Up @@ -231,7 +231,17 @@ def logos_continue_question(question_text, no_text, secondary, app=None):
elif app is None:
cli_continue_question(question_text, no_text, secondary)
elif config.DIALOG == 'curses':
app.screen_q.put(app.stack_confirm(16, app.confirm_q, app.confirm_e, question_text, no_text, secondary, dialog=config.use_python_dialog))
app.screen_q.put(
app.stack_confirm(
16,
app.confirm_q,
app.confirm_e,
question_text,
no_text,
secondary,
dialog=config.use_python_dialog
)
)
else:
logos_error(f"Unhandled question: {question_text}")

Expand Down

0 comments on commit 7967170

Please sign in to comment.