Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jan Zelenka
prasopes
Commits
e64c4dc4
Commit
e64c4dc4
authored
May 20, 2020
by
3Yan
Browse files
Windows exception handling routine added
* After crash, the CLI window should now wait for keypress before closing.
parent
20fb193a
Changes
1
Show whitespace changes
Inline
Side-by-side
prasopes/__main__.py
View file @
e64c4dc4
...
...
@@ -44,6 +44,13 @@ class QStatusBarLogger(logging.Handler):
self
.
trigger
.
signal
.
emit
()
def
show_exception_and_exit
(
exc_type
,
exc_value
,
tb
):
import
traceback
traceback
.
print_exception
(
exc_type
,
exc_value
,
tb
)
raw_input
(
"Press key to exit."
)
sys
.
exit
(
-
1
)
def
load_file
(
parent
,
augCanvas
,
update
,
settings
,
loadthread
,
filename
=
None
):
"""populates dataset and plots it"""
directory
=
augCanvas
.
filename
or
settings
.
value
(
"open_folder"
)
...
...
@@ -243,6 +250,9 @@ def about(parent):
def
main
():
# thx to: https://stackoverflow.com/questions/779675/stop-python-from-closing-on-error/781074#781074
sys
.
excepthook
=
show_exception_and_exit
app
=
QtWidgets
.
QApplication
(
sys
.
argv
)
loadthread
=
QtCore
.
QThread
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment