From 770f62e6fa8f0d5abbc7a7210f5e214fd809a653 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 1 Mar 2021 11:30:37 +0100 Subject: [PATCH] standalone publisher has defined host name in constants and is set on startup --- pype/tools/standalonepublish/app.py | 3 +++ pype/tools/standalonepublish/widgets/constants.py | 1 + pype/tools/standalonepublish/widgets/widget_components.py | 5 +++-- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 pype/tools/standalonepublish/widgets/constants.py diff --git a/pype/tools/standalonepublish/app.py b/pype/tools/standalonepublish/app.py index 920dd32f7c..aef209f5fe 100644 --- a/pype/tools/standalonepublish/app.py +++ b/pype/tools/standalonepublish/app.py @@ -9,6 +9,7 @@ from Qt import QtWidgets, QtCore, QtGui from .widgets import ( AssetWidget, FamilyWidget, ComponentsWidget, ShadowWidget ) +from .widgets.constants import HOST_NAME from avalon import style from pype.api import resources from avalon.api import AvalonMongoDB @@ -208,6 +209,8 @@ class Window(QtWidgets.QDialog): def main(): + os.environ["AVALON_APP"] = HOST_NAME + # Allow to change icon of running process in windows taskbar if os.name == "nt": ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID( diff --git a/pype/tools/standalonepublish/widgets/constants.py b/pype/tools/standalonepublish/widgets/constants.py new file mode 100644 index 0000000000..0ecc8e82e7 --- /dev/null +++ b/pype/tools/standalonepublish/widgets/constants.py @@ -0,0 +1 @@ +HOST_NAME = "standalonepublisher" diff --git a/pype/tools/standalonepublish/widgets/widget_components.py b/pype/tools/standalonepublish/widgets/widget_components.py index 8d627b7eed..d4638ea437 100644 --- a/pype/tools/standalonepublish/widgets/widget_components.py +++ b/pype/tools/standalonepublish/widgets/widget_components.py @@ -7,6 +7,7 @@ import string from Qt import QtWidgets, QtCore from . import DropDataFrame +from .constants import HOST_NAME from avalon import io from pype.api import execute, Logger from pype.lib import get_pype_execute_args @@ -178,8 +179,8 @@ def set_context(project, asset, task): io.Session["current_dir"] = os.path.normpath(os.getcwd()) - os.environ["AVALON_APP"] = "standalonepublish" - io.Session["AVALON_APP"] = "standalonepublish" + os.environ["AVALON_APP"] = HOST_NAME + io.Session["AVALON_APP"] = HOST_NAME io.uninstall()