From 7a7fbc59343e61f06d5aa839fc292f67df8739a6 Mon Sep 17 00:00:00 2001 From: Sergio Zamudio Date: Fri, 26 Mar 2021 17:16:27 -0500 Subject: [PATCH 1/2] SG-21701 Replace instances of Shotgun strings in .py files in all tk-* repos with "SG" --- hooks/publish_file.py | 12 +++++------ .../api/plugins/publish_plugin_instance.py | 4 +--- python/tk_multi_publish2/dialog.py | 6 +++--- .../progress/ui/progress_details_widget.py | 4 ++-- python/tk_multi_publish2/ui/dialog.py | 2 +- tests/test_gui.py | 20 +++++++++---------- 6 files changed, 23 insertions(+), 25 deletions(-) diff --git a/hooks/publish_file.py b/hooks/publish_file.py index b54fad27..517b59fc 100644 --- a/hooks/publish_file.py +++ b/hooks/publish_file.py @@ -210,7 +210,7 @@ def settings(self): ], "description": ( "List of file types to include. Each entry in the list " - "is a list in which the first entry is the Shotgun " + "is a list in which the first entry is the SG " "published file type and subsequent entries are file " "extensions that should be associated." ), @@ -321,7 +321,7 @@ def validate(self, settings, item): # happening. error_msg = ( "Can not validate file path. There is already a publish in " - "Shotgun that matches this path. Please uncheck this " + "SG that matches this path. Please uncheck this " "plugin or save the file to a different path." ) self.logger.error(error_msg) @@ -344,7 +344,7 @@ def validate(self, settings, item): }, ) - self.logger.info("A Publish will be created in Shotgun and linked to:") + self.logger.info("A Publish will be created in SG and linked to:") self.logger.info(" %s" % (path,)) return True @@ -425,11 +425,11 @@ def publish(self, settings, item): item.properties.sg_publish_data = sgtk.util.register_publish(**publish_data) self.logger.info("Publish registered!") self.logger.debug( - "Shotgun Publish data...", + "SG Publish data...", extra={ "action_show_more_info": { - "label": "Shotgun Publish Data", - "tooltip": "Show the complete Shotgun Publish Entity dictionary", + "label": "SG Publish Data", + "tooltip": "Show the complete SG Publish Entity dictionary", "text": "
%s
" % (pprint.pformat(item.properties.sg_publish_data),), } diff --git a/python/tk_multi_publish2/api/plugins/publish_plugin_instance.py b/python/tk_multi_publish2/api/plugins/publish_plugin_instance.py index c9d781c9..6f65dca8 100644 --- a/python/tk_multi_publish2/api/plugins/publish_plugin_instance.py +++ b/python/tk_multi_publish2/api/plugins/publish_plugin_instance.py @@ -182,9 +182,7 @@ def run_validate(self, settings, item): # check that we are not trying to publish to a site level context if item.context.project is None: status = False - self.logger.error( - "Please link '%s' to a Shotgun object and task!" % item.name - ) + self.logger.error("Please link '%s' to a SG object and task!" % item.name) if status: self.logger.debug("Validation successful!") diff --git a/python/tk_multi_publish2/dialog.py b/python/tk_multi_publish2/dialog.py index 6b8529ee..3d0b9869 100644 --- a/python/tk_multi_publish2/dialog.py +++ b/python/tk_multi_publish2/dialog.py @@ -85,7 +85,7 @@ def __init__(self, parent=None): # tooltips for the task and link inputs self.ui.context_widget.set_task_tooltip( "

The task that the selected item will be associated with " - "in Shotgun after publishing. It is recommended to always " + "in SG after publishing. It is recommended to always " "fill out the Task field when publishing. The menu button " "to the right will provide suggestions for Tasks to publish " "including the Tasks assigned to you, recently used Tasks, " @@ -94,7 +94,7 @@ def __init__(self, parent=None): ) self.ui.context_widget.set_link_tooltip( "

The entity that the selected item will be associated with " - "in Shotgun after publishing. By selecting a Task in the field " + "in SG after publishing. By selecting a Task in the field " "above, the Link will automatically be populated. It is " "recommended that you always populate the Task field when " "publishing. The Task menu above will display any tasks associated " @@ -306,7 +306,7 @@ def closeEvent(self, event): # shut down main threadpool self._task_manager.shut_down() except Exception: - logger.exception("Error running Shotgun Panel App closeEvent()") + logger.exception("Error running SG Panel App closeEvent()") # ensure the context widget's recent contexts are saved self.ui.context_widget.save_recent_contexts() diff --git a/python/tk_multi_publish2/progress/ui/progress_details_widget.py b/python/tk_multi_publish2/progress/ui/progress_details_widget.py index 4ed8d714..aae99833 100644 --- a/python/tk_multi_publish2/progress/ui/progress_details_widget.py +++ b/python/tk_multi_publish2/progress/ui/progress_details_widget.py @@ -62,9 +62,9 @@ def setupUi(self, ProgressDetailsWidget): def retranslateUi(self, ProgressDetailsWidget): ProgressDetailsWidget.setWindowTitle(QtGui.QApplication.translate("ProgressDetailsWidget", "Form", None, QtGui.QApplication.UnicodeUTF8)) self.progress_label.setText(QtGui.QApplication.translate("ProgressDetailsWidget", "Progress Details", None, QtGui.QApplication.UnicodeUTF8)) - self.copy_log_button.setToolTip(QtGui.QApplication.translate("ProgressDetailsWidget", "

Open the publisher\'s log file. The log file is useful for deeper debugging of publish issues. For issues involving Shotgun Support, please include a copy of this file when submitting a support request.

", None, QtGui.QApplication.UnicodeUTF8)) + self.copy_log_button.setToolTip(QtGui.QApplication.translate("ProgressDetailsWidget", "

Open the publisher\'s log file. The log file is useful for deeper debugging of publish issues. For issues involving SG Support, please include a copy of this file when submitting a support request.

", None, QtGui.QApplication.UnicodeUTF8)) self.copy_log_button.setText(QtGui.QApplication.translate("ProgressDetailsWidget", "Copy to Clipboard", None, QtGui.QApplication.UnicodeUTF8)) self.close.setToolTip(QtGui.QApplication.translate("ProgressDetailsWidget", "Close", None, QtGui.QApplication.UnicodeUTF8)) - self.log_tree.setAccessibleName(QtGui.QApplication.translate("ProgressDetailsWidget", "

Opens the log file for the current engine which will include log messages from the publisher. This file is extremely useful for deeper debugging and understanding of publish issues. A copy of this file should be included when submitting support requests to the Shotgun Support team.

", None, QtGui.QApplication.UnicodeUTF8)) + self.log_tree.setAccessibleName(QtGui.QApplication.translate("ProgressDetailsWidget", "

Opens the log file for the current engine which will include log messages from the publisher. This file is extremely useful for deeper debugging and understanding of publish issues. A copy of this file should be included when submitting support requests to the SG Support team.

", None, QtGui.QApplication.UnicodeUTF8)) from . import resources_rc diff --git a/python/tk_multi_publish2/ui/dialog.py b/python/tk_multi_publish2/ui/dialog.py index 99171f6f..d890ae82 100644 --- a/python/tk_multi_publish2/ui/dialog.py +++ b/python/tk_multi_publish2/ui/dialog.py @@ -528,7 +528,7 @@ def setupUi(self, Dialog): Dialog.setTabOrder(self.stop_processing, self.scrollArea) def retranslateUi(self, Dialog): - Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Shotgun Publish", None, QtGui.QApplication.UnicodeUTF8)) + Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "SG Publish", None, QtGui.QApplication.UnicodeUTF8)) Dialog.setAccessibleName(QtGui.QApplication.translate("Dialog", "publish dialog", None, QtGui.QApplication.UnicodeUTF8)) self.main_stack.setAccessibleName(QtGui.QApplication.translate("Dialog", "stackedwidget", None, QtGui.QApplication.UnicodeUTF8)) self.large_drop_area_label.setText(QtGui.QApplication.translate("Dialog", "Drag and drop files or folders here", None, QtGui.QApplication.UnicodeUTF8)) diff --git a/tests/test_gui.py b/tests/test_gui.py index 9fc22e23..ec185aa9 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -294,7 +294,7 @@ def test_custom_plugin(app_dialog): # Validation of the Publish to Shotgun with items plugin # Select plugin Publish to Shotgun with items of the first item app_dialog.root["collected items tree"].outlineitems[ - "Publish to Shotgun with items" + "Publish to SG with items" ].mouseClick() # Make sure the checkbox is check if ( @@ -305,9 +305,9 @@ def test_custom_plugin(app_dialog): "Set task to in review" ].mouseClick() # Select plugin Publish to Shotgun with items of the second item - app_dialog.root["collected items tree"].outlineitems[ - "Publish to Shotgun with items" - ][1].mouseClick() + app_dialog.root["collected items tree"].outlineitems["Publish to SG with items"][ + 1 + ].mouseClick() # Make sure the checkbox is unchecked if ( app_dialog.root["details frame"].checkboxes["Set task to in review"].checked @@ -319,7 +319,7 @@ def test_custom_plugin(app_dialog): # Do a multiple plugins selection of item 1 and 2 with holdKeys("{CONTROL}"): app_dialog.root["collected items tree"].outlineitems[ - "Publish to Shotgun with items" + "Publish to SG with items" ].mouseSlide() Mouse.click() @@ -359,7 +359,7 @@ def test_custom_plugin(app_dialog): # Validation of the Publish to Shotgun without items plugin # Select Publish to Shotgun without items of the first item app_dialog.root["collected items tree"].outlineitems[ - "Publish to Shotgun without items" + "Publish to SG without items" ].mouseSlide() Mouse.click() # Make sure the checkbox is check @@ -371,9 +371,9 @@ def test_custom_plugin(app_dialog): "Set task to in review" ].mouseClick() # Select Publish to Shotgun without items of the second item - app_dialog.root["collected items tree"].outlineitems[ - "Publish to Shotgun without items" - ][1].mouseClick() + app_dialog.root["collected items tree"].outlineitems["Publish to SG without items"][ + 1 + ].mouseClick() # Make sure the checkbox is unchecked if ( app_dialog.root["details frame"].checkboxes["Set task to in review"].checked @@ -384,7 +384,7 @@ def test_custom_plugin(app_dialog): ].mouseClick() # Go back the Publish to Shotgun without items plugin of the first item and make sure checkbox is still checked app_dialog.root["collected items tree"].outlineitems[ - "Publish to Shotgun without items" + "Publish to SG without items" ].mouseClick() assert ( app_dialog.root["details frame"].checkboxes["Set task to in review"].checked From f340f269921da45f8815b8360072f6772414c87b Mon Sep 17 00:00:00 2001 From: Jeffery Beeland Date: Mon, 26 Apr 2021 17:28:28 -0700 Subject: [PATCH 2/2] Apply suggestions from code review --- tests/test_gui.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_gui.py b/tests/test_gui.py index ec185aa9..6f6eb24a 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -305,7 +305,7 @@ def test_custom_plugin(app_dialog): "Set task to in review" ].mouseClick() # Select plugin Publish to Shotgun with items of the second item - app_dialog.root["collected items tree"].outlineitems["Publish to SG with items"][ + app_dialog.root["collected items tree"].outlineitems["Publish to Shotgun with items"][ 1 ].mouseClick() # Make sure the checkbox is unchecked @@ -319,7 +319,7 @@ def test_custom_plugin(app_dialog): # Do a multiple plugins selection of item 1 and 2 with holdKeys("{CONTROL}"): app_dialog.root["collected items tree"].outlineitems[ - "Publish to SG with items" + "Publish to Shotgun with items" ].mouseSlide() Mouse.click() @@ -359,7 +359,7 @@ def test_custom_plugin(app_dialog): # Validation of the Publish to Shotgun without items plugin # Select Publish to Shotgun without items of the first item app_dialog.root["collected items tree"].outlineitems[ - "Publish to SG without items" + "Publish to Shotgun without items" ].mouseSlide() Mouse.click() # Make sure the checkbox is check @@ -371,7 +371,7 @@ def test_custom_plugin(app_dialog): "Set task to in review" ].mouseClick() # Select Publish to Shotgun without items of the second item - app_dialog.root["collected items tree"].outlineitems["Publish to SG without items"][ + app_dialog.root["collected items tree"].outlineitems["Publish to Shotgun without items"][ 1 ].mouseClick() # Make sure the checkbox is unchecked @@ -384,7 +384,7 @@ def test_custom_plugin(app_dialog): ].mouseClick() # Go back the Publish to Shotgun without items plugin of the first item and make sure checkbox is still checked app_dialog.root["collected items tree"].outlineitems[ - "Publish to SG without items" + "Publish to Shotgun without items" ].mouseClick() assert ( app_dialog.root["details frame"].checkboxes["Set task to in review"].checked