From bd14b2ca5d758f9ee217e10beb38237893ec7556 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 1 Aug 2025 20:02:08 +0100 Subject: [PATCH 1/5] Reformatted notice HTML --- friture/exceptionhandler.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/friture/exceptionhandler.py b/friture/exceptionhandler.py index f0af17fa..650d453c 100644 --- a/friture/exceptionhandler.py +++ b/friture/exceptionhandler.py @@ -42,17 +42,17 @@ def fileexcepthook(exception_type, exception_value, traceback_object): email = "contact@friture.org" - notice = \ - """

Opps! Something went wrong!

\n\n"""\ - """

Sorry, there was an error we could not handle.

"""\ - """

You can choose to abort, or to ignore the error and try to continue """\ - """(this is not guaranteed to work).

"""\ - """

Please help us fix it!

\n\n"""\ - """

Please contact us directly via email at %s """\ - """and include the log file named %s from the following folder:

"""\ - """

%s

"""\ - """

Alternatively, if you have a GitHub account, you can create a new issue on https://github.com/tlecomte/friture/issues

"""\ - """

Error details

""" % \ + notice = """ +

Opps! Something went wrong!

+

Sorry, there was an error we could not handle.

+

You can choose to abort, or to ignore the error and try to continue + (this is not guaranteed to work).

+

Please help us fix it!

\n\n +

Please contact us directly via email at %s + and include the log file named %s from the following folder:

+

%s

+

Alternatively, if you have a GitHub account, you can create a new issue on https://github.com/tlecomte/friture/issues

+

Error details

""" % \ (email, email, logFileName, logDir, logDir) msg = notice + timeString + ' (%s)' % versionInfo + '
' + exceptionText.replace("\r\n", "\n").replace("\n", "
").replace(" ", ' ') From c3ad56793dc955f07854d7791647827a143d4de7 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 1 Aug 2025 20:03:42 +0100 Subject: [PATCH 2/5] Fixed error notice spelling mistake --- friture/exceptionhandler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/friture/exceptionhandler.py b/friture/exceptionhandler.py index 650d453c..ef625396 100644 --- a/friture/exceptionhandler.py +++ b/friture/exceptionhandler.py @@ -43,7 +43,7 @@ def fileexcepthook(exception_type, exception_value, traceback_object): email = "contact@friture.org" notice = """ -

Opps! Something went wrong!

+

Oops! Something went wrong!

Sorry, there was an error we could not handle.

You can choose to abort, or to ignore the error and try to continue (this is not guaranteed to work).

From 6d4a8f7de506f80326bfb305087e1b20eb44d433 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 1 Aug 2025 20:29:15 +0100 Subject: [PATCH 3/5] Added exception for keyboard interrupts --- friture/analyzer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/friture/analyzer.py b/friture/analyzer.py index 9eaf8c08..d2cf7bee 100755 --- a/friture/analyzer.py +++ b/friture/analyzer.py @@ -194,6 +194,10 @@ def __init__(self): # exception hook that logs to console, file, and display a message box def excepthook(self, exception_type, exception_value, traceback_object): + # a keyboard interrupt is an intentional exit, so close the application + if exception_type is KeyboardInterrupt: + exit(0) + gui_message = fileexcepthook(exception_type, exception_value, traceback_object) # we do not want to flood the user with message boxes when the error happens repeatedly on each timer event From a5fbed025822fb58635a0dd0a8825f428f3e4992 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 1 Aug 2025 20:45:23 +0100 Subject: [PATCH 4/5] Reduced redundency in notice formatting --- friture/exceptionhandler.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/friture/exceptionhandler.py b/friture/exceptionhandler.py index ef625396..65c40d56 100644 --- a/friture/exceptionhandler.py +++ b/friture/exceptionhandler.py @@ -48,12 +48,12 @@ def fileexcepthook(exception_type, exception_value, traceback_object):

You can choose to abort, or to ignore the error and try to continue (this is not guaranteed to work).

Please help us fix it!

\n\n -

Please contact us directly via email at %s - and include the log file named %s from the following folder:

-

%s

+

Please contact us directly via email at {email} + and include the log file named {logFileName} from the following folder:

+

{logDir}1

Alternatively, if you have a GitHub account, you can create a new issue on https://github.com/tlecomte/friture/issues

-

Error details

""" % \ - (email, email, logFileName, logDir, logDir) +

Error details

""" \ + .format(email = email, logFileName = logFileName, logDir = logDir) msg = notice + timeString + ' (%s)' % versionInfo + '
' + exceptionText.replace("\r\n", "\n").replace("\n", "
").replace(" ", ' ') From 7e9686103ccef0aa098e1824b5c1994bf0224fbd Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 1 Aug 2025 21:57:27 +0100 Subject: [PATCH 5/5] Gracefully close on keyboard interrupt --- friture/analyzer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/friture/analyzer.py b/friture/analyzer.py index d2cf7bee..2b6f35e5 100755 --- a/friture/analyzer.py +++ b/friture/analyzer.py @@ -196,6 +196,7 @@ def __init__(self): def excepthook(self, exception_type, exception_value, traceback_object): # a keyboard interrupt is an intentional exit, so close the application if exception_type is KeyboardInterrupt: + self.close() exit(0) gui_message = fileexcepthook(exception_type, exception_value, traceback_object)