Skip to content

Commit

Permalink
Merge pull request #350 from davidlatwe/improve#349
Browse files Browse the repository at this point in the history
Fix GUI message prompting after #349
  • Loading branch information
davidlatwe authored Oct 22, 2019
2 parents 081e0b5 + aca81b4 commit 058fe75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions pyblish_qml/control.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

import json
import time
import logging
import collections

# Dependencies
Expand All @@ -12,7 +11,6 @@
from . import util, models, version, settings

qtproperty = util.pyqtConstantProperty
log = logging.getLogger(__name__)


class Controller(QtCore.QObject):
Expand Down Expand Up @@ -353,11 +351,12 @@ def iterator(self, plugins, context):
signals.pop(order).emit()

if not self.data["state"]["is_running"]:
return log.info("Stopped")
return StopIteration("Stopped")

if test(**state):
self.data["state"]["testPassed"] = False
return log.error("Stopped due to %s" % test(**state))
return StopIteration("Stopped due to %s" % test(**state))

self.data["state"]["testPassed"] = True

try:
Expand All @@ -367,7 +366,7 @@ def iterator(self, plugins, context):
result = self.host.process(plug, context, instance)

except Exception as e:
return log.error("Unknown error: %s" % e)
return StopIteration("Unknown error: %s" % e)

else:
# Make note of the order at which the
Expand Down Expand Up @@ -1018,7 +1017,7 @@ def run(self, plugins, context, callback=None, callback_args=[]):
# the GUI and commence next task.
def on_next(result):
if isinstance(result, StopIteration):
return on_finished()
return on_finished(str(result))

self.data["models"]["item"].update_with_result(result)
self.data["models"]["result"].update_with_result(result)
Expand Down Expand Up @@ -1197,7 +1196,7 @@ def iterator(plugins, context):

message = test(**state)
if message:
return log.error("Stopped due to %s" % message)
return StopIteration("Stopped due to %s" % message)

instances = pyblish.api.instances_by_plugin(context, plugin)
if plugin.__instanceEnabled__:
Expand Down
2 changes: 1 addition & 1 deletion pyblish_qml/version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

VERSION_MAJOR = 1
VERSION_MINOR = 10
VERSION_PATCH = 3
VERSION_PATCH = 4

version_info = (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
version = '%i.%i.%i' % version_info
Expand Down

0 comments on commit 058fe75

Please sign in to comment.