Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SG-21701 Replace instances of Shotgun strings in .py files with "SG" #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,32 +209,32 @@ def pre_app_init(self):
except Exception:
self.logger.debug(
"Was unable to import the flame Python module. As a result, "
"the Flame project will not be linked to associated Shotgun "
"the Flame project will not be linked to associated SG "
"project using the Flame Python API. This shouldn't cause "
"any problems in the current session, but it does mean "
"that the user might be prompted to link this project to a "
"Shotgun project if they launch Flame using the Toolkit "
"SG project if they launch Flame using the Toolkit "
"plugin and open this same Flame project."
)
else:
try:
current_flame_project = flame.project.current_project
current_flame_project.shotgun_project_name = (
self.context.project.get("name")
current_flame_project.shotgun_project_name = self.context.project.get(
"name"
)
except Exception:
self.logger.debug(
"Was unable to set the current Flame project's "
"shotgun_project_name property. This shouldn't cause "
"any problems in the current session, but it does mean "
"that the user might be prompted to link this project to a "
"Shotgun project if they launch Flame using the Toolkit "
"SG project if they launch Flame using the Toolkit "
"plugin and open this same Flame project."
)
else:
self.logger.debug(
"Successfully linked the Flame project to its associated "
"Shotgun project."
"SG project."
)

def _initialize_logging(self, install_root):
Expand Down Expand Up @@ -1410,7 +1410,9 @@ def cmdjob_supports_plugin_name(self):
)

self._cmdjob_supports_plugin_name = False
for line in backburner_job_cmd_usage.communicate()[0].decode("utf-8").split("\n"):
for line in (
backburner_job_cmd_usage.communicate()[0].decode("utf-8").split("\n")
):
if "-pluginName:" in line:
self._cmdjob_supports_plugin_name = True
break
Expand Down Expand Up @@ -1704,7 +1706,7 @@ def create_local_backburner_job(
return backburner_job_id

else:
error = ["Shotgun backburner job could not be created."]
error = ["SG backburner job could not be created."]
if stderr:
error += ["Reason: " + stderr]
error += ["See backburner logs for details."]
Expand Down Expand Up @@ -1824,11 +1826,12 @@ def sgtk_exception_trap(ex_cls, ex, tb):
traceback_str = "\n".join(traceback.format_tb(tb))
if ex_cls == TankError:
# for TankErrors, we don't show the whole stack trace
error_message = "A Shotgun error was reported:\n\n%s" % ex
error_message = "A SG error was reported:\n\n%s" % ex
else:
error_message = (
"A Shotgun error was reported:\n\n%s (%s)\n\nTraceback:\n%s"
% (ex, ex_cls, traceback_str)
error_message = "A SG error was reported:\n\n%s (%s)\n\nTraceback:\n%s" % (
ex,
ex_cls,
traceback_str,
)
except:
pass
Expand All @@ -1839,7 +1842,7 @@ def sgtk_exception_trap(ex_cls, ex, tb):

if QtCore.QCoreApplication.instance():
# there is an application running - so pop up a message!
QtGui.QMessageBox.critical(None, "Shotgun General Error", error_message)
QtGui.QMessageBox.critical(None, "SG General Error", error_message)
except:
pass

Expand Down
2 changes: 1 addition & 1 deletion flame_hooks/sg_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def getMainMenuCustomUIActions():

# sorts the list to have Log out option always appear last, Shotgun Python Console prior, and the rest in same order
context_commands.sort(
key=lambda el: ("Log Out" in el, "Shotgun Python Console..." in el, None)
key=lambda el: ("Log Out" in el, "SG Python Console..." in el, None)
)

# generate flame data structure
Expand Down
4 changes: 2 additions & 2 deletions flame_hooks/sg_project_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def appInitialized(projectName):
engine.logger.debug(
"Was unable to import the flame Python module. As such, "
"it must be assumed that the Flame project change is "
"resulting in a change in Shotgun project. This means "
"resulting in a change in SG project. This means "
"that the user will see a QMessageBox warning if the "
"tk-flame engine's project_switching setting is false. "
"The API to allow this was introduced in 2018.2."
Expand All @@ -85,7 +85,7 @@ def appInitialized(projectName):
QtGui.QMessageBox.warning(
None,
"No project switching!",
"The Shotgun integration does not currently support project switching.\n"
"The SG integration does not currently support project switching.\n"
"Even if you switch projects, any Shotgun-specific configuration will\n"
"remain connected to the initially loaded project.",
)
Expand Down
2 changes: 1 addition & 1 deletion hooks/backburner_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def attach_mov_preview(self, path, width, height, targets, display_name, fps):
return return_code

if self.parent.get_setting("bypass_server_transcoding"):
self.parent.log_debug("Bypass Shotgun transcoding setting enabled.")
self.parent.log_debug("Bypass SG transcoding setting enabled.")
field_name = "sg_uploaded_movie_mp4"
else:
field_name = "sg_uploaded_movie"
Expand Down
4 changes: 2 additions & 2 deletions hooks/project_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ def get_user(self):
shotgun_user = sgtk.util.get_current_user(engine.sgtk)

if shotgun_user is None:
user_name = "Shotgun Unknown"
user_name = "SG Unknown"
engine.log_warning(
"Toolkit was not able to map your machine user name to a "
"user in Shotgun. Your Flame project will be associated with a "
"default 'unknown' user. In order to correctly connect your Flame "
"user with the current Shotgun user, check that the current operating system "
"user with the current SG user, check that the current operating system "
"user name matches the 'login' field of one of the users in Shotgun. "
"Alternatively, if would like a different naming convention, either "
"reconfigure the Flame project startup hook or the Toolkit Core user "
Expand Down
6 changes: 2 additions & 4 deletions hooks/tk-multi-loader2/flame_loader_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,7 @@ def execute_action(self, name, params, sg_publish_data):
# A FlameActionError reaching here means that something major have
# stopped the current action
QtGui.QMessageBox.critical(
None,
"Error",
str(error),
None, "Error", str(error),
)
app.log_error(error)

Expand Down Expand Up @@ -308,7 +306,7 @@ def _add_batch_group_from_shot(self, sg_publish_data, build_new):
sg_info = self._get_batch_info_from_sg_publish_data(sg_publish_data)
if sg_info is None:
raise FlameLoaderActionError(
"Cannot load a Batch Group from Shotgun using this Shot"
"Cannot load a Batch Group from SG using this Shot"
)

self._go_to_batch_on_action()
Expand Down
10 changes: 4 additions & 6 deletions hooks/tk-multi-publish2/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,14 +364,12 @@ def process_current_session(self, settings, parent_item):
# Set the context based on the most precise entity available
if shot:
self.cache_entities(parent_item, [shot])
item.context = (
self.publisher.sgtk.context_from_entity_dictionary(shot)
item.context = self.publisher.sgtk.context_from_entity_dictionary(
shot
)
else:
item.context = (
self.publisher.sgtk.context_from_entity_dictionary(
project
)
item.context = self.publisher.sgtk.context_from_entity_dictionary(
project
)

# This item cannot have another context than this one
Expand Down
2 changes: 1 addition & 1 deletion hooks/tk-multi-publish2/create_cut_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def description(self):
Verbose, multi-line description of what the plugin does. This can
contain simple html for formatting.
"""
return "Creates cut items in Shotgun for the given object"
return "Creates cut items in SG for the given object"

@property
def settings(self):
Expand Down
2 changes: 1 addition & 1 deletion hooks/tk-multi-publish2/create_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def description(self):
Verbose, multi-line description of what the plugin does. This can
contain simple html for formatting.
"""
return "Creates version in Shotgun for the given object"
return "Creates version in SG for the given object"

@property
def settings(self):
Expand Down
2 changes: 1 addition & 1 deletion hooks/tk-multi-publish2/publish_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def description(self):
Verbose, multi-line description of what the plugin does. This can
contain simple html for formatting.
"""
return "Creates publish file in Shotgun for the given object"
return "Creates publish file in SG for the given object"

@property
def settings(self):
Expand Down
2 changes: 1 addition & 1 deletion hooks/tk-multi-publish2/update_cut_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def description(self):
Verbose, multi-line description of what the plugin does. This can
contain simple html for formatting.
"""
return "Update cut items in Shotgun for the given object"
return "Update cut items in SG for the given object"

@property
def settings(self):
Expand Down
2 changes: 1 addition & 1 deletion hooks/tk-multi-publish2/update_shot.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def description(self):
Verbose, multi-line description of what the plugin does. This can
contain simple html for formatting.
"""
return "Update shot in Shotgun for the given object"
return "Update shot in SG for the given object"

@property
def settings(self):
Expand Down
3 changes: 2 additions & 1 deletion python/startup/backburner.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# /usr/discreet/backburner/cmdjob
# -userRights
# -jobName:"Sequence 'aa002' - Uploading media to Shotgun"
# -description:"Creates a new version record in Shotgun and uploads the associated Quicktime."
# -description:"Creates a new version record in SG and uploads the associated Quicktime."
# -servers:Mannes-MacBook-Pro-2.local
# -dependencies:1587902041
# /usr/discreet/Python-2.6.9/bin/python
Expand All @@ -33,6 +33,7 @@
from __future__ import absolute_import
import os
import sys

try:
import sgtk.util.pickle as pickle
except:
Expand Down
2 changes: 1 addition & 1 deletion python/startup/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def bootstrap(engine_instance_name, context, app_path, app_args):

if major_ver < 2016:
raise TankError(
"In order to run the Shotgun integration, you need at least Flame 2016!"
"In order to run the SG integration, you need at least Flame 2016!"
)

# first of all, check that the executable path to Flame exists
Expand Down
4 changes: 2 additions & 2 deletions python/tk_flame/local_movie_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ def generate(
)

self.engine.create_local_backburner_job(
job_name="%s - Updating Shotgun Path to movie" % display_name,
description="Uploading Shotgun Path to movie to %s" % dst_path,
job_name="%s - Updating SG Path to movie" % display_name,
description="Uploading SG Path to movie to %s" % dst_path,
dependencies=job_id,
instance="backburner_hooks",
method_name="update_path_to_movie",
Expand Down
2 changes: 1 addition & 1 deletion python/tk_flame/local_movie_generator_flame.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _generate(
dst_path=dst_path,
extension=os.path.splitext(dst_path)[-1],
display_name=display_name,
job_context="Create Shotgun Local Movie",
job_context="Create SG Local Movie",
preset_path=self.engine.local_movies_preset_path,
asset_info=asset_info,
dependencies=dependencies,
Expand Down
2 changes: 1 addition & 1 deletion python/tk_flame/thumbnail_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def generate(
# a thumbnail
bypass_server_transcoding = self.engine.get_setting("bypass_server_transcoding")
if bypass_server_transcoding:
self.engine.log_debug("Bypass Shotgun transcoding setting ENABLED.")
self.engine.log_debug("Bypass SG transcoding setting ENABLED.")

generate_previews = favor_preview and self.engine.get_setting(
"generate_previews"
Expand Down
4 changes: 2 additions & 2 deletions python/tk_flame/thumbnail_generator_ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _generate_preview(
the media is created in foreground.
"""
self.engine.log_debug("Create and Upload Preview using ffmpeg")
job_context = "Create and Upload Shotgun Preview"
job_context = "Create and Upload SG Preview"
job_name = self.engine.sanitize_backburner_job_name(
job_name=display_name, job_suffix=" - %s" % job_context
)
Expand Down Expand Up @@ -92,7 +92,7 @@ def _generate_thumbnail(
the media is created in foreground.
"""
self.engine.log_debug("Create and Upload Thumbnail using ffmpeg")
job_context = "Create and Upload Shotgun Thumbnail"
job_context = "Create and Upload SG Thumbnail"
job_name = self.engine.sanitize_backburner_job_name(
job_name=display_name, job_suffix=" - %s" % job_context
)
Expand Down
10 changes: 5 additions & 5 deletions python/tk_flame/thumbnail_generator_flame.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def _generate_preview(
dst_path=None,
extension=".mov",
display_name=display_name,
job_context="Create Shotgun Preview",
job_context="Create SG Preview",
preset_path=self.engine.previews_preset_path,
asset_info=asset_info,
dependencies=dependencies,
Expand Down Expand Up @@ -110,7 +110,7 @@ def _generate_thumbnail(
dst_path=None,
extension=".jpg",
display_name=display_name,
job_context="Create Shotgun Thumbnail",
job_context="Create SG Thumbnail",
preset_path=self.engine.thumbnails_preset_path,
asset_info=asset_info,
dependencies=dependencies,
Expand All @@ -136,7 +136,7 @@ def _upload_thumbnail_job(self, thumbnail_job):
:param thumbnail_job: Thumbnail generation job information.
:return: Backburner job ID created.
"""
job_context = "Upload Shotgun Thumbnail"
job_context = "Upload SG Thumbnail"
job_name = self.engine.sanitize_backburner_job_name(
job_name=thumbnail_job.get("display_name"), job_suffix=" - %s" % job_context
)
Expand Down Expand Up @@ -168,12 +168,12 @@ def _upload_preview_job(self, preview_job):
:return: Backburner job ID created.
"""
if self.engine.get_setting("bypass_server_transcoding"):
self.engine.log_debug("Bypass Shotgun transcoding setting ENABLED.")
self.engine.log_debug("Bypass SG transcoding setting ENABLED.")
field_name = "sg_uploaded_movie_mp4"
else:
field_name = "sg_uploaded_movie"

job_context = "Upload Shotgun Preview"
job_context = "Upload SG Preview"
job_name = self.engine.sanitize_backburner_job_name(
job_name=preview_job.get("display_name"), job_suffix=" - %s" % job_context
)
Expand Down
4 changes: 3 additions & 1 deletion python/tk_flame/transcoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ def _create_open_clip_file(self, src_path, asset_info):
</tracks>
</clip>""".format(
**metadata
).encode("utf-8"),
).encode(
"utf-8"
),
)
os.close(tmp_fd)
return path
Expand Down
4 changes: 2 additions & 2 deletions python/tk_flame/ui/project_create_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,13 +491,13 @@ def retranslateUi(self, ProjectCreateDialog):
self.label_9.setText("")
self.label_5.setText(QCoreApplication.translate("ProjectCreateDialog", "<b>Project Name</b>", None))
#if QT_CONFIG(tooltip)
self.project_name.setToolTip(QCoreApplication.translate("ProjectCreateDialog", "The <b>Flame project name</b> is automatically generated based on your current Shotgun project. ", None))
self.project_name.setToolTip(QCoreApplication.translate("ProjectCreateDialog", "The <b>Flame project name</b> is automatically generated based on your current SG project. ", None))
#endif // QT_CONFIG(tooltip)
self.project_name.setText(QCoreApplication.translate("ProjectCreateDialog", "xxx", None))
self.label_7.setText(QCoreApplication.translate("ProjectCreateDialog", "<b>Storage Volume</b>", None))
self.label_6.setText(QCoreApplication.translate("ProjectCreateDialog", "<b>User</b>", None))
#if QT_CONFIG(tooltip)
self.user_name.setToolTip(QCoreApplication.translate("ProjectCreateDialog", "The <b>User Name</b> associated with your new Flame Project is based on the Shotgun user that matches your current login name.\n"
self.user_name.setToolTip(QCoreApplication.translate("ProjectCreateDialog", "The <b>User Name</b> associated with your new Flame Project is based on the SG user that matches your current login name.\n"
"", None))
#endif // QT_CONFIG(tooltip)
self.user_name.setText(QCoreApplication.translate("ProjectCreateDialog", "xxx", None))
Expand Down
2 changes: 1 addition & 1 deletion python/tk_flame/wiretap.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def _ensure_project_exists(self, project_name, user_name, workspace_name):

xml += (
"<Description>%s</Description>"
% "Created by Shotgun Flame Integration %s"
% "Created by SG Flame Integration %s"
% self._engine.version
)

Expand Down
2 changes: 1 addition & 1 deletion resources/build_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function build_qt {

# replace PySide2 imports with tank.platform.qt and remove line containing Created by date
sed -i"" -E "s/^(from PySide2)(.*)$/try:\n from tank.platform.qt\2\nexcept ImportError:\n \1\2/g" $UI_PYTHON_PATH/$3.py
sed -i"" -E 's/u\"/\"/g' $UI_PYTHON_PATH/$3.py
sed -i"" -E 's/u\"/\"/g' $UI_PYTHON_PATH/$3.py
}

function build_ui {
Expand Down
Loading