From d3ab1caf3a3f5a6206b50e944e478cededa91bb7 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sun, 2 Aug 2020 15:14:46 +0200 Subject: [PATCH] Block the error handler dialog in test mode --- nw/error.py | 7 ++++++- nw/gui/build.py | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/nw/error.py b/nw/error.py index cb276752..0301f3ba 100644 --- a/nw/error.py +++ b/nw/error.py @@ -77,13 +77,16 @@ def exceptionHandler(exType, exValue, exTrace): """ import logging from traceback import print_tb, format_tb - from nw import __issuesurl__ + from nw import CONFIG from PyQt5.QtWidgets import qApp, QApplication, QErrorMessage, QMessageBox logger = logging.getLogger(__name__) logger.error("%s: %s" % (exType.__name__, str(exValue))) print_tb(exTrace) + if not CONFIG.showGUI: + return + try: nwGUI = None for qWin in qApp.topLevelWidgets(): @@ -104,3 +107,5 @@ def exceptionHandler(exType, exValue, exTrace): except Exception as e: logger.error(str(e)) + + return diff --git a/nw/gui/build.py b/nw/gui/build.py index 34a01f05..93aa8271 100644 --- a/nw/gui/build.py +++ b/nw/gui/build.py @@ -432,7 +432,6 @@ class GuiBuildNovel(QDialog): def _buildPreview(self): """Build a preview of the project in the document viewer. """ - # Get Settings fmtTitle = self.fmtTitle.text().strip() fmtChapter = self.fmtChapter.text().strip()