Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FluEgg
fluegg
Commits
e0ac3f60
Commit
e0ac3f60
authored
Sep 25, 2020
by
Domanski, Marian M.
Browse files
Merge branch 'master' into 60-v4-1-0-subject-matter-expert-review
parents
b052dfe9
09976876
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
e0ac3f60
...
...
@@ -117,3 +117,5 @@ MATLAB/
# FluEgg results
results/
error_log.txt
app.py
View file @
e0ac3f60
import
os
import
sys
from
PyQt5.QtWidgets
import
QApplication
import
traceback
import
logging
from
PyQt5.QtWidgets
import
QApplication
,
QMessageBox
from
PyQt5.QtCore
import
Qt
import
fluegg
import
fluegggui
from
fluegggui.gui
import
AppWindow
if
__name__
==
'__main__'
:
# Initialize the UI
fluegg
.
set_logging_level
(
'critical'
)
app
=
QApplication
(
sys
.
argv
)
w
=
AppWindow
()
w
.
show
()
sys
.
exit
(
app
.
exec_
())
class
FluEggApp
:
def
__init__
(
self
):
log_filename
=
os
.
path
.
join
(
os
.
getcwd
(),
'error_log.txt'
)
formatter
=
logging
.
Formatter
(
'%(asctime)s - %(message)s'
)
fh
=
logging
.
FileHandler
(
log_filename
,
delay
=
True
)
fh
.
setLevel
(
logging
.
ERROR
)
fh
.
setFormatter
(
formatter
)
fluegggui
.
logger
.
addHandler
(
fh
)
fluegg
.
set_logging_level
(
'error'
)
fluegggui
.
set_logging_level
(
'error'
)
sys
.
excepthook
=
self
.
excepthook
self
.
_app
=
None
self
.
_w
=
None
self
.
_log_file
=
log_filename
def
excepthook
(
self
,
etype
,
evalue
,
tb
):
fluegggui
.
logger
.
error
(
'Unhandled error occurred'
)
for
line
in
traceback
.
format_exception
(
etype
,
evalue
,
tb
):
fluegggui
.
logger
.
error
(
line
.
strip
())
QMessageBox
.
warning
(
self
.
_w
,
'Unhandled Exception'
,
'An unhandled exception occurred.
\n\n
'
+
'See the file
\n
{}
\n
'
.
format
(
self
.
_log_file
)
+
'for more information.'
)
def
run_app
(
self
):
self
.
_app
=
QApplication
(
sys
.
argv
)
self
.
_w
=
AppWindow
()
self
.
_w
.
show
()
return
self
.
_app
.
exec_
()
fluegg_app
=
FluEggApp
()
app_exit_code
=
fluegg_app
.
run_app
()
sys
.
exit
(
app_exit_code
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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