Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripts: Disable markup in error messages #20072

Merged
merged 2 commits into from Jul 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions launch-game.sh
Expand Up @@ -46,9 +46,9 @@ if [ $? != 0 ] && [ $? != 1 ]; then
fi

test -d Support/Logs && LOGS="${PWD}/Support/Logs"
ERROR_MESSAGE="OpenRA has encountered a fatal error.\nPlease refer to the crash logs and FAQ for more information.\n\nLog files are located in ${LOGS}\nThe FAQ is available at http://wiki.openra.net/FAQ"
ERROR_MESSAGE=$(printf "%s has encountered a fatal error.\nPlease refer to the crash logs and FAQ for more information.\n\nLog files are located in %s\nThe FAQ is available at http://wiki.openra.net/FAQ" "OpenRA" "${LOGS}")
if command -v zenity > /dev/null; then
zenity --no-wrap --error --title "OpenRA" --text "${ERROR_MESSAGE}" 2> /dev/null
zenity --no-wrap --error --title "OpenRA" --no-markup --text "${ERROR_MESSAGE}" 2> /dev/null
elif command -v kdialog > /dev/null; then
kdialog --title "OpenRA" --error "${ERROR_MESSAGE}"
else
Expand Down
6 changes: 3 additions & 3 deletions packaging/linux/gtk-dialog.py
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python3
"""A simple GTK3 graphical dialog helper that can be used as a fallback if zenity is not available
Compatible with python 2 or 3 with the gi bindings.

Expand Down Expand Up @@ -43,6 +43,6 @@ def __init__(self, title, text):
parser.add_argument('--text', type=str, required=False, default='')
args = parser.parse_args()
if args.type == 'question':
Question(args.title, args.text.replace('\\n', '\n'))
abcdefg30 marked this conversation as resolved.
Show resolved Hide resolved
Question(args.title, args.text)
elif args.type == 'error':
Error(args.title, args.text.replace('\\n', '\n'))
Error(args.title, args.text)
6 changes: 3 additions & 3 deletions packaging/linux/openra.appimage.in
Expand Up @@ -53,15 +53,15 @@ if [ $? != 0 ] && [ $? != 1 ]; then
fi

test -d Support/Logs && LOGS="${PWD}/Support/Logs"
ERROR_MESSAGE="{MODNAME} has encountered a fatal error.\nPlease refer to the crash logs and FAQ for more information.\n\nLog files are located in ${LOGS}\nThe FAQ is available at http://wiki.openra.net/FAQ"
ERROR_MESSAGE=$(printf "%s has encountered a fatal error.\nPlease refer to the crash logs and FAQ for more information.\n\nLog files are located in %s\nThe FAQ is available at http://wiki.openra.net/FAQ" "{MODNAME}" "${LOGS}")
if command -v zenity > /dev/null; then
zenity --no-wrap --error --title "{MODNAME}" --text "${ERROR_MESSAGE}" 2> /dev/null
zenity --no-wrap --error --title "{MODNAME}" --no-markup --text "${ERROR_MESSAGE}" 2> /dev/null
elif command -v kdialog > /dev/null; then
kdialog --title "{MODNAME}" --error "${ERROR_MESSAGE}"
elif "${HERE}/gtk-dialog.py" test > /dev/null; then
"${HERE}/gtk-dialog.py" error --title "{MODNAME}" --text "${ERROR_MESSAGE}" 2> /dev/null
else
printf "${ERROR_MESSAGE}\n"
echo "${ERROR_MESSAGE}"
fi
exit 1
fi
6 changes: 3 additions & 3 deletions packaging/linux/openra.in
Expand Up @@ -19,13 +19,13 @@ if [ $? != 0 ] && [ $? != 1 ]; then
fi

test -d Support/Logs && LOGS="${PWD}/Support/Logs"
ERROR_MESSAGE="{MODNAME} has encountered a fatal error.\nPlease refer to the crash logs and FAQ for more information.\n\nLog files are located in ${LOGS}\nThe FAQ is available at http://wiki.openra.net/FAQ"
ERROR_MESSAGE=$(printf "%s has encountered a fatal error.\nPlease refer to the crash logs and FAQ for more information.\n\nLog files are located in %s\nThe FAQ is available at http://wiki.openra.net/FAQ" "{MODNAME}" "${LOGS}")
if command -v zenity > /dev/null; then
zenity --no-wrap --error --title "{MODNAME}" --text "${ERROR_MESSAGE}" 2> /dev/null
zenity --no-wrap --error --title "{MODNAME}" --no-markup --text "${ERROR_MESSAGE}" 2> /dev/null
elif command -v kdialog > /dev/null; then
kdialog --title "{MODNAME}" --error "${ERROR_MESSAGE}"
else
printf "${ERROR_MESSAGE}\n"
echo "${ERROR_MESSAGE}"
fi
exit 1
fi