Skip to content

Commit

Permalink
rename shotgun to shotgrid
Browse files Browse the repository at this point in the history
  • Loading branch information
clement.hector authored and ClementHector committed Feb 7, 2022
1 parent e46431b commit 5bc1da3
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 23 deletions.
File renamed without changes.
3 changes: 3 additions & 0 deletions openpype/modules/shotgrid/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from openpype.modules.shotgrid.shotgrid_module import ShotgridModule

__all__ = ("ShotgridModule",)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from openpype.lib import PostLaunchHook


class PostShotgunHook(PostLaunchHook):
class PostShotgridHook(PostLaunchHook):
order = None

def execute(self, *args, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
from typing import Optional, Dict, AnyStr, Any

from openpype.modules import PypeModule, ITrayModule, IPluginPaths, ILaunchHookPaths
from openpype.modules.shotgun.tray.shotgun_tray import ShotgunTrayWrapper
from openpype.modules.shotgrid.tray.shotgrid_tray import ShotgridTrayWrapper

SHOTGUN_MODULE_DIR = os.path.dirname(os.path.abspath(__file__))
SHOTGRID_MODULE_DIR = os.path.dirname(os.path.abspath(__file__))


class ShotgunModule(PypeModule, ITrayModule, IPluginPaths, ILaunchHookPaths):
name: str = "shotgun"
class ShotgridModule(PypeModule, ITrayModule, IPluginPaths, ILaunchHookPaths):
name: str = "shotgrid"
enabled: bool = False
project_id: Optional[str] = None
tray_wrapper: ShotgunTrayWrapper
tray_wrapper: ShotgridTrayWrapper

def initialize(self, modules_settings: Dict[AnyStr, Any]):
shotgun_settings = modules_settings.get(self.name, dict())
self.enabled = shotgun_settings.get("enabled", False)
self.project_id = shotgun_settings.get("project_id")
shotgrid_settings = modules_settings.get(self.name, dict())
self.enabled = shotgrid_settings.get("enabled", False)
self.project_id = shotgrid_settings.get("project_id")

# if self.enabled and not self.project_id:
# raise Exception("Project id is not set in settings.")
Expand All @@ -28,13 +28,13 @@ def get_global_environments(self) -> Dict[AnyStr, Any]:
return {"PROJECT_ID": self.project_id}

def get_plugin_paths(self) -> Dict[AnyStr, Any]:
return {"publish": [os.path.join(SHOTGUN_MODULE_DIR, "plugins", "publish")]}
return {"publish": [os.path.join(SHOTGRID_MODULE_DIR, "plugins", "publish")]}

def get_launch_hook_paths(self) -> AnyStr:
return os.path.join(SHOTGUN_MODULE_DIR, "hooks")
return os.path.join(SHOTGRID_MODULE_DIR, "hooks")

def tray_init(self):
self.tray_wrapper = ShotgunTrayWrapper(self)
self.tray_wrapper = ShotgridTrayWrapper(self)

def tray_start(self):
return self.tray_wrapper.validate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, module, parent=None):

self._module = module
self._is_logged = False
self.setWindowTitle("OpenPype - Shotgun Login")
self.setWindowTitle("OpenPype - Shotgrid Login")

self.setWindowFlags(
QtCore.Qt.WindowCloseButtonHint | QtCore.Qt.WindowMinimizeButtonHint
Expand All @@ -40,7 +40,7 @@ def __init__(self, module, parent=None):
self.ui_init()

def ui_init(self):
self.url_label = QtWidgets.QLabel("Shotgun URL:")
self.url_label = QtWidgets.QLabel("Shotgrid URL:")
self.login_label = QtWidgets.QLabel("Login:")
self.password_label = QtWidgets.QLabel("Password:")
# self.url_input = QtWidgets.QLabel()
Expand All @@ -50,7 +50,7 @@ def ui_init(self):
# self.url_input.setCursor(QtGui.QCursor(QtCore.Qt.IBeamCursor))

self.url_input = QtWidgets.QLineEdit()
self.url_input.setPlaceholderText("shotgun url")
self.url_input.setPlaceholderText("shotgrid url")

self.login_input = QtWidgets.QLineEdit()
self.login_input.setPlaceholderText("login")
Expand All @@ -66,7 +66,7 @@ def ui_init(self):
self.input_layout.addRow(self.password_label, self.password_input)

self.login_button = QtWidgets.QPushButton("Login")
self.login_button.setToolTip("Login into shotgun instance")
self.login_button.setToolTip("Login into shotgrid instance")
self.buttons_layout = QtWidgets.QHBoxLayout()
self.buttons_layout.addWidget(self.login_button)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from typing import Any

from openpype.modules.shotgun.tray.credential_dialog import CredentialsDialog
from openpype.modules.shotgrid.tray.credential_dialog import CredentialsDialog
from Qt import QtWidgets


class ShotgunTrayWrapper:
class ShotgridTrayWrapper:
module: Any
credentials_dialog: CredentialsDialog

Expand All @@ -22,8 +22,8 @@ def show_credential_dialog(self):

def tray_menu(self, tray_menu):
print(type(tray_menu))
menu = QtWidgets.QMenu("Shotgun", tray_menu)
show_connect_action = QtWidgets.QAction("Connect to Shotgun", menu)
menu = QtWidgets.QMenu("Shotgrid", tray_menu)
show_connect_action = QtWidgets.QAction("Connect to Shotgrid", menu)
show_connect_action.triggered.connect(self.show_connect_dialog)
menu.addAction(show_connect_action)

Expand Down
3 changes: 0 additions & 3 deletions openpype/modules/shotgun/__init__.py

This file was deleted.

0 comments on commit 5bc1da3

Please sign in to comment.