fixed imports in new publisher

This commit is contained in:
iLLiCiTiT 2021-08-25 09:58:13 +02:00
parent 869965a4b1
commit 866fc2146d
5 changed files with 27 additions and 44 deletions

View file

@ -0,0 +1,5 @@
from .app import show
__all__ = (
"show",
)

View file

@ -0,0 +1,17 @@
from .window import PublisherWindow
class _WindowCache:
window = None
def show(parent=None):
window = _WindowCache.window
if window is None:
window = PublisherWindow()
_WindowCache.window = window
window.show()
window.activateWindow()
return window

View file

@ -26,7 +26,7 @@ __all__ = (
"SubsetAttributesWidget",
"PublishOverlayFrame",
"PublishFrame",
"CreateDialog",

View file

@ -2,7 +2,7 @@ import collections
from Qt import QtWidgets, QtCore, QtGui
from constants import (
from ..constants import (
INSTANCE_ID_ROLE,
SORT_VALUE_ROLE
)

View file

@ -1,35 +1,9 @@
import os
import sys
openpype_dir = ""
mongo_url = ""
project_name = ""
asset_name = ""
task_name = ""
host_name = ""
os.environ["OPENPYPE_MONGO"] = mongo_url
os.environ["AVALON_MONGO"] = mongo_url
os.environ["AVALON_PROJECT"] = project_name
os.environ["AVALON_ASSET"] = asset_name
os.environ["AVALON_TASK"] = task_name
os.environ["AVALON_APP"] = host_name
os.environ["OPENPYPE_DATABASE_NAME"] = "openpype"
os.environ["AVALON_CONFIG"] = "openpype"
os.environ["AVALON_TIMEOUT"] = "1000"
os.environ["AVALON_DB"] = "avalon"
for path in [
openpype_dir,
r"{}\repos\avalon-core".format(openpype_dir),
r"{}\.venv\Lib\site-packages".format(openpype_dir)
]:
sys.path.append(path)
from Qt import QtWidgets
from openpype import style
from control import PublisherController
from widgets import (
from .control import PublisherController
from .widgets import (
PublishFrame,
SubsetAttributesWidget,
InstanceCardView,
@ -381,16 +355,3 @@ class PublisherWindow(QtWidgets.QWidget):
self.validate_btn.setEnabled(validate_enabled)
self.publish_btn.setEnabled(publish_enabled)
def main():
"""Main function for testing purposes."""
app = QtWidgets.QApplication([])
window = PublisherWindow()
window.show()
app.exec_()
if __name__ == "__main__":
main()