Skip to content

Commit

Permalink
Replaced duplicate updater message modal with syslog call
Browse files Browse the repository at this point in the history
  • Loading branch information
zenmonkeykstop committed Dec 6, 2019
1 parent bb2f04a commit 432343c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions journalist_gui/journalist_gui/SecureDropUpdater.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import pexpect
import socket
import sys
import syslog as log

from journalist_gui import updaterUI, strings, resources_rc # noqa

Expand Down Expand Up @@ -35,9 +36,7 @@ def prevent_second_instance(app: QtWidgets.QApplication, name: str) -> None: #
app.instance_binding.bind(IDENTIFIER)
except OSError as e:
if e.errno == ALREADY_BOUND_ERRNO:
err_dialog = QtWidgets.QMessageBox()
err_dialog.setText(name + strings.app_is_already_running)
err_dialog.exec()
log.syslog(log.LOG_NOTICE, name + strings.app_is_already_running)
sys.exit()
else:
raise
Expand Down
2 changes: 1 addition & 1 deletion journalist_gui/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


@mock.patch('journalist_gui.SecureDropUpdater.sys.exit')
@mock.patch('journalist_gui.SecureDropUpdater.QtWidgets.QMessageBox')
@mock.patch('syslog.syslog')
class TestSecondInstancePrevention(unittest.TestCase):
def setUp(self):
self.mock_app = mock.MagicMock()
Expand Down

0 comments on commit 432343c

Please sign in to comment.