Skip to content

Commit

Permalink
Cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
mottosso committed Sep 2, 2018
1 parent 6ea9b6d commit 7b3277c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
18 changes: 7 additions & 11 deletions pyblish_qml/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,7 @@ def _foster_ninja(foster):
return False

value = os.environ.get("PYBLISH_QML_FOSTER_NINJA", "").lower()
if value in ("true", "yes", "1"):
return True

elif value in ("false", "no", "0"):
return False

else:
if QtCore.qVersion()[0] == "5":
return True
else:
return False
return value in ("true", "yes", "1") or QtCore.qVersion()[0] == "5"


def show(parent=None, targets=[], modal=None, foster=None):
Expand All @@ -130,6 +120,12 @@ def show(parent=None, targets=[], modal=None, foster=None):
Requires install() to have been run first, and
a live instance of Pyblish QML in the background.
Arguments:
parent (None, optional): Deprecated
targets (list, optional): Publishing targets
modal (bool, optional): Block interactions to parent
foster (bool, optional): Become a real child of the parent process
"""

# Get modal mode from environment
Expand Down
13 changes: 9 additions & 4 deletions pyblish_qml/ipc/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,12 @@ def show(self, settings=None):
settings (optional, dict): Client settings
"""
if not self.ninja:
if self.ninja:
return self._dispatch("show", args=[settings or {},
self._winId,
self.ninja])
else:
self.vessel.show()
return self._dispatch("show", args=[settings or {},
self._winId,
self.ninja])

def hide(self):
"""Hide the GUI"""
Expand Down Expand Up @@ -224,6 +225,10 @@ class Server(object):
service (service.Service): Dispatch requests to this service
python (str, optional): Absolute path to Python executable
pyqt5 (str, optional): Absolute path to PyQt5
targets (list, optional): Publishing targets, e.g. `ftrack`
modal (bool, optional): Block interactions to parent
foster (bool, optional): Become a real child of the parent process
ninja (bool, optional): ...?
"""

Expand Down

0 comments on commit 7b3277c

Please sign in to comment.