mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
OP-2414 - Hound
This commit is contained in:
parent
d953507314
commit
755d7a1d95
6 changed files with 13 additions and 14 deletions
|
|
@ -3,8 +3,6 @@
|
||||||
Anything that isn't defined here is INTERNAL and unreliable for external use.
|
Anything that isn't defined here is INTERNAL and unreliable for external use.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from . import plugin
|
|
||||||
|
|
||||||
from .pipeline import (
|
from .pipeline import (
|
||||||
ls,
|
ls,
|
||||||
install,
|
install,
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ import signal
|
||||||
import time
|
import time
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
from Qt import QtWidgets, QtCore, QtGui
|
from Qt import QtWidgets, QtCore, QtGui
|
||||||
import queue
|
|
||||||
import collections
|
import collections
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@ def file_extensions():
|
||||||
|
|
||||||
def has_unsaved_changes():
|
def has_unsaved_changes():
|
||||||
if ProcessContext.server:
|
if ProcessContext.server:
|
||||||
return ProcessContext.server.send({"function": "scene.isDirty"})["result"]
|
return ProcessContext.server.send(
|
||||||
|
{"function": "scene.isDirty"})["result"]
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,8 +97,8 @@ class StdOutBroker:
|
||||||
return self.webserver_client and self._std_available
|
return self.webserver_client and self._std_available
|
||||||
|
|
||||||
def _connect_to_tray(self):
|
def _connect_to_tray(self):
|
||||||
""" Connect to Tray webserver to pass console output. """
|
"""Connect to Tray webserver to pass console output. """
|
||||||
if not self._std_available: # not content to log
|
if not self._std_available: # not content to log
|
||||||
return
|
return
|
||||||
ws = websocket.WebSocket()
|
ws = websocket.WebSocket()
|
||||||
webserver_url = os.environ.get("OPENPYPE_WEBSERVER_URL")
|
webserver_url = os.environ.get("OPENPYPE_WEBSERVER_URL")
|
||||||
|
|
@ -120,7 +120,7 @@ class StdOutBroker:
|
||||||
self._send(payload)
|
self._send(payload)
|
||||||
|
|
||||||
def _disconnect_from_tray(self):
|
def _disconnect_from_tray(self):
|
||||||
""" Send to Tray that host is closing - remove from Services. """
|
"""Send to Tray that host is closing - remove from Services. """
|
||||||
print("Host {} closing".format(self.host_name))
|
print("Host {} closing".format(self.host_name))
|
||||||
if not self.webserver_client:
|
if not self.webserver_client:
|
||||||
return
|
return
|
||||||
|
|
@ -136,7 +136,7 @@ class StdOutBroker:
|
||||||
self.webserver_client.close()
|
self.webserver_client.close()
|
||||||
|
|
||||||
def host_connected(self):
|
def host_connected(self):
|
||||||
""" Send to Tray console that host is ready - icon change. """
|
"""Send to Tray console that host is ready - icon change. """
|
||||||
log.info("Host {} connected".format(self.host_id))
|
log.info("Host {} connected".format(self.host_id))
|
||||||
|
|
||||||
payload = {
|
payload = {
|
||||||
|
|
@ -153,7 +153,7 @@ class StdOutBroker:
|
||||||
self.websocket_server.stop_server(restart=True)
|
self.websocket_server.stop_server(restart=True)
|
||||||
|
|
||||||
def exit(self):
|
def exit(self):
|
||||||
""" Exit whole application. """
|
"""Exit whole application. """
|
||||||
self._disconnect_from_tray()
|
self._disconnect_from_tray()
|
||||||
|
|
||||||
if self.websocket_server:
|
if self.websocket_server:
|
||||||
|
|
@ -203,7 +203,7 @@ class StdOutBroker:
|
||||||
self._send(payload)
|
self._send(payload)
|
||||||
|
|
||||||
def _send(self, payload):
|
def _send(self, payload):
|
||||||
""" Worker method to send to existing websocket connection."""
|
"""Worker method to send to existing websocket connection."""
|
||||||
if not self.send_to_tray:
|
if not self.send_to_tray:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
@ -234,7 +234,7 @@ class StdOutBroker:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def color(message):
|
def color(message):
|
||||||
""" Color message with html tags. """
|
"""Color message with html tags. """
|
||||||
message = StdOutBroker._multiple_replace(message,
|
message = StdOutBroker._multiple_replace(message,
|
||||||
StdOutBroker.sdict)
|
StdOutBroker.sdict)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,8 @@ exclude =
|
||||||
__pycache__,
|
__pycache__,
|
||||||
docs,
|
docs,
|
||||||
*/vendor,
|
*/vendor,
|
||||||
website
|
website,
|
||||||
|
openpype/vendor
|
||||||
|
|
||||||
max-complexity = 30
|
max-complexity = 30
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue