From 7ff248f6c9c30fed830d56c7cb85454671c3f407 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Apr 2021 16:24:01 +0200 Subject: [PATCH 1/3] replaced pype usage with openpype --- .../settings/defaults/system_settings/general.json | 2 +- pype/settings/entities/__init__.py | 4 ++-- pype/settings/entities/base_entity.py | 14 +++++++------- pype/settings/entities/schemas/README.md | 4 ++-- .../schemas/system_schema/schema_general.json | 4 ++-- pype/settings/handlers.py | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/pype/settings/defaults/system_settings/general.json b/pype/settings/defaults/system_settings/general.json index 99db4e85c6..f21634dc87 100644 --- a/pype/settings/defaults/system_settings/general.json +++ b/pype/settings/defaults/system_settings/general.json @@ -15,7 +15,7 @@ ] } }, - "pype_path": { + "openpype_path": { "windows": [], "darwin": [], "linux": [] diff --git a/pype/settings/entities/__init__.py b/pype/settings/entities/__init__.py index 2ff911e7d4..d4a7fea304 100644 --- a/pype/settings/entities/__init__.py +++ b/pype/settings/entities/__init__.py @@ -1,7 +1,7 @@ """Pype Settings -Settings define how pype and it's modules behave. They became main component of -dynamism. +Settings define how openpype and it's modules behave. They became main +component of dynamism. Pype settings (ATM) have 3 layers: 1.) Defaults - defined in code diff --git a/pype/settings/entities/base_entity.py b/pype/settings/entities/base_entity.py index c01fca6a4e..88afdc8c93 100644 --- a/pype/settings/entities/base_entity.py +++ b/pype/settings/entities/base_entity.py @@ -611,8 +611,8 @@ class BaseItemEntity(BaseEntity): def remove_from_studio_default(self, on_change_trigger=None): """Remove studio overrides from entity and it's children. - Reset values to pype's default and mark entity to not store values as - studio overrides if entity is not under group. + Reset values to openpype's default and mark entity to not store values + as studio overrides if entity is not under group. This is wrapper method that handles on_change callbacks only when all `_remove_from_studio_default` on all children happened. That is @@ -672,8 +672,8 @@ class BaseItemEntity(BaseEntity): def remove_from_project_override(self, on_change_trigger=None): """Remove project overrides from entity and it's children. - Reset values to studio overrides or pype's default and mark entity to - not store values as project overrides if entity is not under group. + Reset values to studio overrides or openpype's default and mark entity + to not store values as project overrides if entity is not under group. This is wrapper method that handles on_change callbacks only when all `_remove_from_project_override` on all children happened. That is @@ -837,9 +837,9 @@ class ItemEntity(BaseItemEntity): def update_default_value(self, parent_values): """Fill default values on startup or on refresh. - Default values stored in `pype` repository should update all items in - schema. Each item should take values for his key and set it's value or - pass values down to children items. + Default values stored in `openpype` repository should update all items + in schema. Each item should take values for his key and set it's value + or pass values down to children items. Args: parent_values (dict): Values of parent's item. But in case item is diff --git a/pype/settings/entities/schemas/README.md b/pype/settings/entities/schemas/README.md index e92ba8918f..18312a8364 100644 --- a/pype/settings/entities/schemas/README.md +++ b/pype/settings/entities/schemas/README.md @@ -7,9 +7,9 @@ - each input may have "input modifiers" (keys in dictionary) that are required or optional - only required modifier for all input items is key `"type"` which says what type of item it is - there are special keys across all inputs - - `"is_file"` - this key is for storing pype defaults in `pype` repo + - `"is_file"` - this key is for storing openpype defaults in `openpype` repo - reasons of existence: developing new schemas does not require to create defaults manually - - key is validated, must be once in hierarchy else it won't be possible to store pype defaults + - key is validated, must be once in hierarchy else it won't be possible to store openpype defaults - `"is_group"` - define that all values under key in hierarchy will be overriden if any value is modified, this information is also stored to overrides - this keys is not allowed for all inputs as they may have not reason for that - key is validated, can be only once in hierarchy but is not required diff --git a/pype/settings/entities/schemas/system_schema/schema_general.json b/pype/settings/entities/schemas/system_schema/schema_general.json index 26dc251acf..fd650b4a1e 100644 --- a/pype/settings/entities/schemas/system_schema/schema_general.json +++ b/pype/settings/entities/schemas/system_schema/schema_general.json @@ -29,8 +29,8 @@ }, { "type": "path", - "key": "pype_path", - "label": "Pype Path", + "key": "openpype_path", + "label": "Versions Repository", "multiplatform": true, "multipath": true } diff --git a/pype/settings/handlers.py b/pype/settings/handlers.py index b4f9aa0826..13cb9b9ba5 100644 --- a/pype/settings/handlers.py +++ b/pype/settings/handlers.py @@ -227,9 +227,9 @@ class MongoSettingsHandler(SettingsHandler): def _prepare_global_settings(self, data): output = {} - # Add "pype_path" key to global settings if is set - if "general" in data and "pype_path" in data["general"]: - output["pype_path"] = data["general"]["pype_path"] + # Add "openpype_path" key to global settings if is set + if "general" in data and "openpype_path" in data["general"]: + output["openpype_path"] = data["general"]["openpype_path"] return output def save_studio_settings(self, data): From c2e916dcc57249896fea49be135ca58db02dc8ee Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Apr 2021 16:33:51 +0200 Subject: [PATCH 2/3] changed pype to openpype in setting ui and some functions --- pype/lib/__init__.py | 4 ++-- pype/lib/local_settings.py | 4 ++-- pype/settings/entities/__init__.py | 6 ++--- .../settings/local_settings/mongo_widget.py | 22 +++++++++---------- pype/tools/settings/local_settings/window.py | 4 ++-- pype/tools/settings/settings/README.md | 6 ++--- .../tools/settings/settings/widgets/window.py | 2 +- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pype/lib/__init__.py b/pype/lib/__init__.py index f4282f7ea3..bf3610da95 100644 --- a/pype/lib/__init__.py +++ b/pype/lib/__init__.py @@ -106,7 +106,7 @@ from .local_settings import ( JSONSettingRegistry, PypeSettingsRegistry, get_local_site_id, - change_pype_mongo_url + change_openpype_mongo_url ) from .path_tools import ( @@ -219,7 +219,7 @@ __all__ = [ "JSONSettingRegistry", "PypeSettingsRegistry", "get_local_site_id", - "change_pype_mongo_url", + "change_openpype_mongo_url", "timeit", diff --git a/pype/lib/local_settings.py b/pype/lib/local_settings.py index aa372a52d2..03883c0a94 100644 --- a/pype/lib/local_settings.py +++ b/pype/lib/local_settings.py @@ -496,10 +496,10 @@ def get_local_site_id(): return _create_local_site_id() -def change_pype_mongo_url(new_mongo_url): +def change_openpype_mongo_url(new_mongo_url): """Change mongo url in pype registry. - Change of Pype mongo URL require restart of running pype processes or + Change of OpenPype mongo URL require restart of running pype processes or processes using pype. """ diff --git a/pype/settings/entities/__init__.py b/pype/settings/entities/__init__.py index d4a7fea304..f76a915225 100644 --- a/pype/settings/entities/__init__.py +++ b/pype/settings/entities/__init__.py @@ -1,9 +1,9 @@ -"""Pype Settings +"""OpenPype Settings Settings define how openpype and it's modules behave. They became main component of dynamism. -Pype settings (ATM) have 3 layers: +OpenPype settings (ATM) have 3 layers: 1.) Defaults - defined in code 2.) Studio overrides - values that are applied on default that may modify only some values or None, result can be called "studio settings" @@ -24,7 +24,7 @@ visuallise how values are applied. With help of setting entities it is possible to modify settings from code. -Pype has (ATM) 2 types of settings: +OpenPype has (ATM) 2 types of settings: 1.) System settings - global system settings, don't have project overrides 2.) Project settings - project specific settings diff --git a/pype/tools/settings/local_settings/mongo_widget.py b/pype/tools/settings/local_settings/mongo_widget.py index c6f6ab1591..1e60b43cc6 100644 --- a/pype/tools/settings/local_settings/mongo_widget.py +++ b/pype/tools/settings/local_settings/mongo_widget.py @@ -5,16 +5,16 @@ import traceback from Qt import QtWidgets from pymongo.errors import ServerSelectionTimeoutError -from pype.api import change_pype_mongo_url +from pype.api import change_openpype_mongo_url -class PypeMongoWidget(QtWidgets.QWidget): +class OpenPypeMongoWidget(QtWidgets.QWidget): def __init__(self, parent): - super(PypeMongoWidget, self).__init__(parent) + super(OpenPypeMongoWidget, self).__init__(parent) # Warning label warning_label = QtWidgets.QLabel(( - "WARNING: Requires restart. Change of Pype Mongo requires to" + "WARNING: Requires restart. Change of OpenPype Mongo requires to" " restart of all running Pype processes and process using Pype" " (Including this)." "\n- all changes in different categories won't be saved." @@ -22,11 +22,11 @@ class PypeMongoWidget(QtWidgets.QWidget): warning_label.setStyleSheet("font-weight: bold;") # Label - mongo_url_label = QtWidgets.QLabel("Pype Mongo URL", self) + mongo_url_label = QtWidgets.QLabel("OpenPype Mongo URL", self) # Input mongo_url_input = QtWidgets.QLineEdit(self) - mongo_url_input.setPlaceholderText("< Pype Mongo URL >") + mongo_url_input.setPlaceholderText("< OpenPype Mongo URL >") mongo_url_input.setText(os.environ["PYPE_MONGO"]) # Confirm button @@ -48,14 +48,14 @@ class PypeMongoWidget(QtWidgets.QWidget): dialog = QtWidgets.QMessageBox(self) - title = "Pype mongo changed" + title = "OpenPype mongo changed" message = ( - "Pype mongo url was successfully changed. Restart Pype please." + "OpenPype mongo url was successfully changed. Restart Pype please." ) details = None try: - change_pype_mongo_url(value) + change_openpype_mongo_url(value) except Exception as exc: if isinstance(exc, ServerSelectionTimeoutError): error_message = ( @@ -65,10 +65,10 @@ class PypeMongoWidget(QtWidgets.QWidget): else: error_message = str(exc) - title = "Pype mongo change failed" + title = "OpenPype mongo change failed" # TODO catch exception message more gracefully message = ( - "Pype mongo change was not successful." + "OpenPype mongo change was not successful." " Full traceback can be found in details section.\n\n" "Error message:\n{}" ).format(error_message) diff --git a/pype/tools/settings/local_settings/window.py b/pype/tools/settings/local_settings/window.py index c5f5d15831..b2c32d135e 100644 --- a/pype/tools/settings/local_settings/window.py +++ b/pype/tools/settings/local_settings/window.py @@ -17,7 +17,7 @@ from .widgets import ( SpacerWidget, ExpandingWidget ) -from .mongo_widget import PypeMongoWidget +from .mongo_widget import OpenPypeMongoWidget from .general_widget import LocalGeneralWidgets from .apps_widget import LocalApplicationsWidgets from .projects_widget import ProjectSettingsWidget @@ -62,7 +62,7 @@ class LocalSettingsWidget(QtWidgets.QWidget): pype_mongo_layout.setContentsMargins(CHILD_OFFSET, 5, 0, 0) pype_mongo_expand_widget.set_content_widget(pype_mongo_content) - pype_mongo_widget = PypeMongoWidget(self) + pype_mongo_widget = OpenPypeMongoWidget(self) pype_mongo_layout.addWidget(pype_mongo_widget) self.main_layout.addWidget(pype_mongo_expand_widget) diff --git a/pype/tools/settings/settings/README.md b/pype/tools/settings/settings/README.md index 65d73a0728..31d8fc5b74 100644 --- a/pype/tools/settings/settings/README.md +++ b/pype/tools/settings/settings/README.md @@ -7,9 +7,9 @@ - each input may have "input modifiers" (keys in dictionary) that are required or optional - only required modifier for all input items is key `"type"` which says what type of item it is - there are special keys across all inputs - - `"is_file"` - this key is for storing pype defaults in `pype` repo + - `"is_file"` - this key is for storing openpype defaults in `openpype` repo - reasons of existence: developing new schemas does not require to create defaults manually - - key is validated, must be once in hierarchy else it won't be possible to store pype defaults + - key is validated, must be once in hierarchy else it won't be possible to store openpype defaults - `"is_group"` - define that all values under key in hierarchy will be overriden if any value is modified, this information is also stored to overrides - this keys is not allowed for all inputs as they may have not reason for that - key is validated, can be only once in hierarchy but is not required @@ -191,7 +191,7 @@ { "type": "boolean", "key": "my_boolean_key", - "label": "Do you want to use Pype?" + "label": "Do you want to use OpenPype?" } ``` diff --git a/pype/tools/settings/settings/widgets/window.py b/pype/tools/settings/settings/widgets/window.py index 058611c36a..96275facff 100644 --- a/pype/tools/settings/settings/widgets/window.py +++ b/pype/tools/settings/settings/widgets/window.py @@ -15,7 +15,7 @@ class MainWidget(QtWidgets.QWidget): def __init__(self, user_role, parent=None): super(MainWidget, self).__init__(parent) self.setObjectName("MainWidget") - self.setWindowTitle("Pype Settings") + self.setWindowTitle("OpenPype Settings") self.resize(self.widget_width, self.widget_height) From 5bc1a77578606eeac104c33d7bb597b85e1aee59 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Apr 2021 17:45:37 +0200 Subject: [PATCH 3/3] fix change_openpype_mongo_url import --- pype/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/api.py b/pype/api.py index 37e878580a..ce18097eca 100644 --- a/pype/api.py +++ b/pype/api.py @@ -24,7 +24,7 @@ from .lib import ( get_latest_version, get_global_environments, get_local_site_id, - change_pype_mongo_url + change_openpype_mongo_url ) from .lib.mongo import ( @@ -120,5 +120,5 @@ __all__ = [ "get_global_environments", "get_local_site_id", - "change_pype_mongo_url" + "change_openpype_mongo_url" ]