more folder naming

This commit is contained in:
Jakub Trllo 2024-02-28 16:23:22 +01:00
parent 284d395b01
commit 93ad1ad9a3
4 changed files with 16 additions and 19 deletions

View file

@ -1062,7 +1062,7 @@ class AbstractPublisherController(object):
creator_identifier,
variant,
task_name,
asset_name,
folder_path,
instance_id=None
):
"""Get product name based on passed data.
@ -1072,7 +1072,7 @@ class AbstractPublisherController(object):
responsible for product name creation.
variant (str): Variant value from user's input.
task_name (str): Name of task for which is instance created.
asset_name (str): Name of asset for which is instance created.
folder_path (str): Folder path for which is instance created.
instance_id (Union[str, None]): Existing instance id when product
name is updated.
"""
@ -1091,7 +1091,7 @@ class AbstractPublisherController(object):
creator_identifier (str): Identifier of Creator plugin.
product_name (str): Calculated product name.
instance_data (Dict[str, Any]): Base instance data with variant,
asset name and task name.
folder path and task name.
options (Dict[str, Any]): Data from pre-create attributes.
"""
@ -1667,10 +1667,10 @@ class PublisherController(BasePublisherController):
@property
def current_folder_path(self):
"""Current context asset name defined by host.
"""Current context folder path defined by host.
Returns:
Union[str, None]: Asset name or None if asset is not set.
Union[str, None]: Folder path or None if folder is not set.
"""
return self._create_context.get_current_asset_name()

View file

@ -251,9 +251,6 @@ class QtRemotePublishController(BasePublisherController):
pass
def get_asset_hierarchy(self):
pass
def get_existing_product_names(self, folder_path):
pass
@ -299,7 +296,7 @@ class QtRemotePublishController(BasePublisherController):
creator_identifier,
variant,
task_name,
asset_name,
folder_path,
instance_id=None
):
"""Get product name based on passed data.
@ -309,7 +306,7 @@ class QtRemotePublishController(BasePublisherController):
responsible for product name creation.
variant (str): Variant value from user's input.
task_name (str): Name of task for which is instance created.
asset_name (str): Name of asset for which is instance created.
folder_path (str): Folder path for which is instance created.
instance_id (Union[str, None]): Existing instance id when product
name is updated.
"""
@ -328,7 +325,7 @@ class QtRemotePublishController(BasePublisherController):
creator_identifier (str): Identifier of Creator plugin.
product_name (str): Calculated product name.
instance_data (Dict[str, Any]): Base instance data with variant,
asset name and task name.
folder path and task name.
options (Dict[str, Any]): Data from pre-create attributes.
"""

View file

@ -211,7 +211,7 @@ class CreateContextWidget(QtWidgets.QWidget):
return self._tasks_widget.get_selected_task_type()
def update_current_context_btn(self):
# Hide set current asset if there is no one
# Hide set current folder if there is no one
folder_path = self._controller.current_folder_path
self._current_context_btn.setVisible(bool(folder_path))

View file

@ -342,7 +342,7 @@ class CreateWidget(QtWidgets.QWidget):
def _get_task_name(self):
task_name = None
if self._context_change_is_enabled():
# Don't use selection of task if asset is not set
# Don't use selection of task if folder is not set
folder_path = self._context_widget.get_selected_folder_path()
if folder_path:
task_name = self._context_widget.get_selected_task_name()
@ -367,7 +367,7 @@ class CreateWidget(QtWidgets.QWidget):
current_folder_path = self._controller.current_folder_path
current_task_name = self._controller.current_task_name
# Get context before refresh to keep selection of asset and
# Get context before refresh to keep selection of folder and
# task widgets
folder_path = self._get_folder_path()
task_name = self._get_task_name()
@ -392,8 +392,8 @@ class CreateWidget(QtWidgets.QWidget):
self._prereq_available = False
# Disable context widget so refresh of asset will use context asset
# name
# Disable context widget so refresh of folder will use context folder
# path
self._set_context_enabled(False)
# Refresh data before update of creators
@ -429,7 +429,7 @@ class CreateWidget(QtWidgets.QWidget):
self._context_change_is_enabled()
and self._get_folder_path() is None
):
# QUESTION how to handle invalid asset?
# QUESTION how to handle invalid folder?
prereq_available = False
creator_btn_tooltips.append("Context is not selected")
@ -451,7 +451,7 @@ class CreateWidget(QtWidgets.QWidget):
def _refresh_product_name(self):
folder_path = self._get_folder_path()
# Skip if asset did not change
# Skip if folder did not change
if self._folder_path and self._folder_path == folder_path:
return
@ -686,7 +686,7 @@ class CreateWidget(QtWidgets.QWidget):
self._validate_product_name(product_name, variant_value)
def _validate_product_name(self, product_name, variant_value):
# Get all products of the current asset
# Get all products of the current folder
if self._product_names:
existing_product_names = set(self._product_names)
else: