From ccaf07c39622c059164115426aeff00f204afd0b Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Mon, 22 Dec 2014 00:19:06 -0500 Subject: [PATCH] Updated pycode.core. --- CadQuery/Libs/pyqode/core/managers/backend.py | 6 ++++-- CadQuery/Libs/pyqode/core/modes/filewatcher.py | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CadQuery/Libs/pyqode/core/managers/backend.py b/CadQuery/Libs/pyqode/core/managers/backend.py index a82efec..cabbdf4 100644 --- a/CadQuery/Libs/pyqode/core/managers/backend.py +++ b/CadQuery/Libs/pyqode/core/managers/backend.py @@ -56,6 +56,9 @@ class BackendManager(Manager): The script can be run with a custom interpreter. The default is to use sys.executable. + .. note:: This restart the backend process if it was previously + running. + :param script: Path to the backend script. :param interpreter: The python interpreter to use to run the backend script. If None, sys.executable is used unless we are in a frozen @@ -64,8 +67,7 @@ class BackendManager(Manager): the backend process. """ if self.running: - # already started - return + self.stop() self.server_script = script self.interpreter = interpreter self.args = args diff --git a/CadQuery/Libs/pyqode/core/modes/filewatcher.py b/CadQuery/Libs/pyqode/core/modes/filewatcher.py index 207c445..37eabad 100644 --- a/CadQuery/Libs/pyqode/core/modes/filewatcher.py +++ b/CadQuery/Libs/pyqode/core/modes/filewatcher.py @@ -18,6 +18,9 @@ class FileWatcherMode(Mode, QtCore.QObject): #: the editor. file_deleted = QtCore.Signal(object) + #: Signal emitted when the file has been reloaded in the editor. + file_reloaded = QtCore.Signal() + @property def auto_reload(self): """ @@ -145,6 +148,7 @@ class FileWatcherMode(Mode, QtCore.QObject): def inner_action(*args): """ Inner action: open file """ self.editor.file.open(self.editor.file.path) + self.file_reloaded.emit() args = ("File changed", "The file %s has changed externally.\nDo you want to "