mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
added some docstrings
This commit is contained in:
parent
e6042d9889
commit
a06f629a08
1 changed files with 112 additions and 11 deletions
|
|
@ -797,10 +797,12 @@ class AbstractPublisherController(object):
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def reset(self):
|
def reset(self):
|
||||||
pass
|
"""Reset whole controller.
|
||||||
|
|
||||||
|
This should reset create context, publish context and all variables
|
||||||
|
that are related to it.
|
||||||
|
"""
|
||||||
|
|
||||||
@abstractmethod
|
|
||||||
def emit_card_message(self, message):
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
|
|
@ -828,52 +830,113 @@ class AbstractPublisherController(object):
|
||||||
def create(
|
def create(
|
||||||
self, creator_identifier, subset_name, instance_data, options
|
self, creator_identifier, subset_name, instance_data, options
|
||||||
):
|
):
|
||||||
pass
|
"""Trigger creation by creator identifier.
|
||||||
|
|
||||||
|
Should also trigger refresh of instanes.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
creator_identifier (str): Identifier of Creator plugin.
|
||||||
|
subset_name (str): Calculated subset name.
|
||||||
|
instance_data (Dict[str, Any]): Base instance data with variant,
|
||||||
|
asset name and task name.
|
||||||
|
options (Dict[str, Any]): Data from pre-create attributes.
|
||||||
|
"""
|
||||||
|
|
||||||
def save_changes(self):
|
def save_changes(self):
|
||||||
"""Save changes happened during creation."""
|
"""Save changes in create context."""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def remove_instances(self, instances):
|
def remove_instances(self, instances):
|
||||||
"""Remove list of instances."""
|
"""Remove list of instances from create context."""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractproperty
|
@abstractproperty
|
||||||
def publish_has_finished(self):
|
def publish_has_finished(self):
|
||||||
|
"""Has publishing finished.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool: If publishing finished and all plugins were iterated.
|
||||||
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractproperty
|
@abstractproperty
|
||||||
def publish_is_running(self):
|
def publish_is_running(self):
|
||||||
|
"""Publishing is running right now.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool: If publishing is in progress.
|
||||||
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractproperty
|
@abstractproperty
|
||||||
def publish_has_validated(self):
|
def publish_has_validated(self):
|
||||||
|
"""Publish validation passed.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool: If publishing passed last possible validation order.
|
||||||
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractproperty
|
@abstractproperty
|
||||||
def publish_has_crashed(self):
|
def publish_has_crashed(self):
|
||||||
|
"""Publishing crashed for any reason.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool: Publishing crashed.
|
||||||
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractproperty
|
@abstractproperty
|
||||||
def publish_has_validation_errors(self):
|
def publish_has_validation_errors(self):
|
||||||
|
"""During validation happened at least one validation error.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool: Validation error was raised during validation.
|
||||||
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractproperty
|
@abstractproperty
|
||||||
def publish_max_progress(self):
|
def publish_max_progress(self):
|
||||||
|
"""Get maximum possible progress number.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int: Number that can be used as 100% of publish progress bar.
|
||||||
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractproperty
|
@abstractproperty
|
||||||
def publish_progress(self):
|
def publish_progress(self):
|
||||||
|
"""Current progress number.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int: Current progress value which is between 0 and
|
||||||
|
'publish_max_progress'.
|
||||||
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractproperty
|
@abstractproperty
|
||||||
def publish_comment_is_set(self):
|
def publish_comment_is_set(self):
|
||||||
|
"""Publish comment was at least once set.
|
||||||
|
|
||||||
|
Publish comment can be set only once when publish is started for a
|
||||||
|
first time. This helpt to idetify if 'set_comment' should be called or
|
||||||
|
not.
|
||||||
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def get_publish_crash_error(self):
|
def get_publish_crash_error(self):
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
|
|
@ -884,30 +947,68 @@ class AbstractPublisherController(object):
|
||||||
def get_validation_errors(self):
|
def get_validation_errors(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
|
||||||
def set_comment(self, comment):
|
|
||||||
pass
|
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def publish(self):
|
def publish(self):
|
||||||
|
"""Trigger publishing without any order limitations."""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def validate(self):
|
def validate(self):
|
||||||
|
"""Trigger publishing which will stop after validation order."""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def stop_publish(self):
|
def stop_publish(self):
|
||||||
|
"""Stop publishing can be also used to pause publishing.
|
||||||
|
|
||||||
|
Pause of publishing is possible only if all plugins successfully
|
||||||
|
finished.
|
||||||
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def run_action(self, plugin, action):
|
def run_action(self, plugin_id, action_id):
|
||||||
|
"""Trigger pyblish action on a plugin.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
plugin_id (str): Id of publish plugin.
|
||||||
|
action_id (str): Id of publish action.
|
||||||
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def reset_project_data_cache(self):
|
def reset_project_data_cache(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def set_comment(self, comment):
|
||||||
|
"""Set comment on pyblish context.
|
||||||
|
|
||||||
|
Set "comment" key on current pyblish.api.Context data.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
comment (str): Artist's comment.
|
||||||
|
"""
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def emit_card_message(self, message):
|
||||||
|
"""Emit a card message which can have a lifetime.
|
||||||
|
|
||||||
|
This is for UI purposes. Method can be extended to more arguments
|
||||||
|
in future e.g. different message timeout or type (color).
|
||||||
|
|
||||||
|
Args:
|
||||||
|
message (str): Message that will be showed.
|
||||||
|
"""
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class PublisherController(AbstractPublisherController):
|
class PublisherController(AbstractPublisherController):
|
||||||
"""Middleware between UI, CreateContext and publish Context.
|
"""Middleware between UI, CreateContext and publish Context.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue