From 8c7183e9c598fa0d8a2ffc20e5ede6e516d508a1 Mon Sep 17 00:00:00 2001 From: Paul Charmoille Date: Wed, 21 Dec 2016 12:50:13 +0100 Subject: [PATCH 1/2] Add hotkey to menu options --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index a011f823..bc15e1f4 100644 --- a/app.py +++ b/app.py @@ -31,7 +31,7 @@ def init_app(self): # register command cb = lambda : tk_multi_loader.show_dialog(self) menu_caption = "%s..." % self.get_setting("menu_name") - menu_options = { "short_name": self.get_setting("menu_name").replace(" ", "_") } + menu_options = { "short_name": self.get_setting("menu_name").replace(" ", "_"), 'hotkey': self.get_setting('hotkey') } self.engine.register_command(menu_caption, cb, menu_options) @property From e0b4370c00a05bd97691a167f26f7d0736cd9bca Mon Sep 17 00:00:00 2001 From: Paul Charmoille Date: Wed, 21 Dec 2016 12:52:07 +0100 Subject: [PATCH 2/2] pep8 --- app.py | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/app.py b/app.py index bc15e1f4..cb87af73 100644 --- a/app.py +++ b/app.py @@ -1,37 +1,32 @@ # Copyright (c) 2015 Shotgun Software Inc. -# # CONFIDENTIAL AND PROPRIETARY -# -# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit +# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. -# By accessing, using, copying or modifying this work you indicate your -# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights +# By accessing, using, copying or modifying this work you indicate your +# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights # not expressly granted therein are reserved by Shotgun Software Inc. """ A loader application that lets you add new items to the scene. """ -from sgtk.platform.qt import QtCore, QtGui import sgtk -import sys -import os class MultiLoader(sgtk.platform.Application): - + def init_app(self): """ Called as the application is being initialized """ - + tk_multi_loader = self.import_module("tk_multi_loader") - + # register command - cb = lambda : tk_multi_loader.show_dialog(self) + cb = lambda: tk_multi_loader.show_dialog(self) menu_caption = "%s..." % self.get_setting("menu_name") - menu_options = { "short_name": self.get_setting("menu_name").replace(" ", "_"), 'hotkey': self.get_setting('hotkey') } + menu_options = {"short_name": self.get_setting("menu_name").replace(" ", "_"), 'hotkey': self.get_setting('hotkey')} self.engine.register_command(menu_caption, cb, menu_options) @property @@ -41,7 +36,7 @@ def context_change_allowed(self): """ return True - def open_publish(self, title="Open Publish", action="Open", publish_types = []): + def open_publish(self, title="Open Publish", action="Open", publish_types=[]): """ Display the loader UI in an open-file style where a publish can be selected and the artist can then click the action button. This will then return the selected publish.