Rename GUIProcess.started to _started.
It's unneeded for this to be public, and it conflicts with the pyqtSignal.
This commit is contained in:
parent
ad401e035f
commit
8a87b5d357
@ -47,7 +47,7 @@ class GUIProcess(QObject):
|
|||||||
Args:
|
Args:
|
||||||
cmd: The command which was started.
|
cmd: The command which was started.
|
||||||
args: A list of arguments which gets passed.
|
args: A list of arguments which gets passed.
|
||||||
started: Whether the underlying process is started.
|
_started: Whether the underlying process is started.
|
||||||
_proc: The underlying QProcess.
|
_proc: The underlying QProcess.
|
||||||
_win_id: The window ID this process is used in.
|
_win_id: The window ID this process is used in.
|
||||||
_what: What kind of thing is spawned (process/editor/userscript/...).
|
_what: What kind of thing is spawned (process/editor/userscript/...).
|
||||||
@ -68,7 +68,7 @@ class GUIProcess(QObject):
|
|||||||
self._win_id = win_id
|
self._win_id = win_id
|
||||||
self._what = what
|
self._what = what
|
||||||
self._verbose = verbose
|
self._verbose = verbose
|
||||||
self.started = False
|
self._started = False
|
||||||
self.cmd = None
|
self.cmd = None
|
||||||
self.args = None
|
self.args = None
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ class GUIProcess(QObject):
|
|||||||
@pyqtSlot(int, QProcess.ExitStatus)
|
@pyqtSlot(int, QProcess.ExitStatus)
|
||||||
def on_finished(self, code, status):
|
def on_finished(self, code, status):
|
||||||
"""Show a message when the process finished."""
|
"""Show a message when the process finished."""
|
||||||
self.started = False
|
self._started = False
|
||||||
log.procs.debug("Process finished with code {}, status {}.".format(
|
log.procs.debug("Process finished with code {}, status {}.".format(
|
||||||
code, status))
|
code, status))
|
||||||
if status == QProcess.CrashExit:
|
if status == QProcess.CrashExit:
|
||||||
@ -116,12 +116,12 @@ class GUIProcess(QObject):
|
|||||||
def on_started(self):
|
def on_started(self):
|
||||||
"""Called when the process started successfully."""
|
"""Called when the process started successfully."""
|
||||||
log.procs.debug("Process started.")
|
log.procs.debug("Process started.")
|
||||||
assert not self.started
|
assert not self._started
|
||||||
self.started = True
|
self._started = True
|
||||||
|
|
||||||
def _pre_start(self, cmd, args):
|
def _pre_start(self, cmd, args):
|
||||||
"""Prepare starting of a QProcess."""
|
"""Prepare starting of a QProcess."""
|
||||||
if self.started:
|
if self._started:
|
||||||
raise ValueError("Trying to start a running QProcess!")
|
raise ValueError("Trying to start a running QProcess!")
|
||||||
self.cmd = cmd
|
self.cmd = cmd
|
||||||
self.args = args
|
self.args = args
|
||||||
@ -146,7 +146,7 @@ class GUIProcess(QObject):
|
|||||||
|
|
||||||
if ok:
|
if ok:
|
||||||
log.procs.debug("Process started.")
|
log.procs.debug("Process started.")
|
||||||
self.started = True
|
self._started = True
|
||||||
else:
|
else:
|
||||||
message.error(self._win_id, "Error while spawning {}: {}.".format(
|
message.error(self._win_id, "Error while spawning {}: {}.".format(
|
||||||
self._what, self._proc.error()), immediately=True)
|
self._what, self._proc.error()), immediately=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user