moved standalone publish from tools into pype

This commit is contained in:
Jakub Trllo 2019-04-19 11:47:23 +02:00
parent 009615cf18
commit f6b6f730a8
39 changed files with 12 additions and 22 deletions

View file

@ -1,3 +1,4 @@
from .asapublish_module import ASAPublishModule
from .app import (
show,
cli

View file

@ -10,6 +10,8 @@ from .widgets import *
# Move this to pype lib?
from avalon.tools.libraryloader.io_nonsingleton import DbConnector
module = sys.modules[__name__]
module.window = None
class Window(QtWidgets.QDialog):
_db = DbConnector()
@ -22,7 +24,7 @@ class Window(QtWidgets.QDialog):
NOT_SELECTED = '< Nothing is selected >'
def __init__(self, parent=None):
super(Window, self).__init__(parent)
super(Window, self).__init__()
self._db.install()
self.setWindowTitle("Standalone Publish")
@ -172,18 +174,10 @@ class Window(QtWidgets.QDialog):
data.update(self.widget_assets.collect_data())
data.update(self.widget_family.collect_data())
data.update(self.widget_components.collect_data())
return data
def show(parent=None, debug=False, context=None):
"""Display Loader GUI
Arguments:
debug (bool, optional): Run loader in debug-mode,
defaults to False
"""
def show(parent=None, debug=False):
try:
module.window.close()
del module.window
@ -191,7 +185,7 @@ def show(parent=None, debug=False, context=None):
pass
with parentlib.application():
window = Window(parent, context)
window = Window(parent)
window.show()
module.window = window

View file

@ -23,7 +23,9 @@ pyblish.api.register_plugin_path(PUBLISH_PATH)
def set_context(project, asset, app):
os.environ["AVALON_PROJECT"] = project
io.Session["AVALON_PROJECT"] = project
os.environ["AVALON_ASSET"] = asset
io.Session["AVALON_ASSET"] = asset
io.install()

View file

Before

Width:  |  Height:  |  Size: 730 B

After

Width:  |  Height:  |  Size: 730 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 803 B

After

Width:  |  Height:  |  Size: 803 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 484 B

After

Width:  |  Height:  |  Size: 484 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 257 KiB

After

Width:  |  Height:  |  Size: 257 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 5 KiB

After

Width:  |  Height:  |  Size: 5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 823 B

After

Width:  |  Height:  |  Size: 823 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 661 B

After

Width:  |  Height:  |  Size: 661 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 663 B

After

Width:  |  Height:  |  Size: 663 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 120 B

After

Width:  |  Height:  |  Size: 120 B

Before After
Before After

View file

@ -11,7 +11,7 @@ class DropDataFrame(QtWidgets.QFrame):
super().__init__()
self.parent_widget = parent
self.items = []
self.presets = config.get_presets()['tools']['standalone_publish']
self.presets = config.get_presets()['standalone_publish']
self.setAcceptDrops(True)
layout = QtWidgets.QVBoxLayout(self)
@ -267,7 +267,7 @@ class DropDataFrame(QtWidgets.QFrame):
icon += 's'
data['icon'] = icon
data['thumb'] = (
ext in self.presets['thumbnailable'] and
ext in self.presets['extensions']['thumbnailable'] and
data['is_sequence'] is False
)
data['prev'] = ext in self.presets['extensions']['video_file']

View file

@ -247,9 +247,7 @@ class FamilyWidget(QtWidgets.QWidget):
def refresh(self):
has_families = False
presets = config.get_presets().get('tools', {}).get(
'standalone_publish', {}
)
presets = config.get_presets().get('standalone_publish', {})
for creator in presets.get('families', {}).values():
creator = namedtuple("Creator", creator.keys())(*creator.values())

View file

@ -1,5 +0,0 @@
from . import cli
if __name__ == '__main__':
import sys
sys.exit(cli(sys.argv[1:]))