tik_manager4.objects.publish ============================ .. py:module:: tik_manager4.objects.publish .. autoapi-nested-parse:: Publish object module. Attributes ---------- .. autoapisummary:: tik_manager4.objects.publish.LOG Classes ------- .. autoapisummary:: tik_manager4.objects.publish.Publish Module Contents --------------- .. py:class:: Publish(work_object) Bases: :py:obj:`tik_manager4.mixins.localize.LocalizeMixin` Class to represent a publish. Publish objects are created from the work objects. Publishes are the final versions of the works. Publishes are not editable. This class is not represented by a file. Publish-PublishVersion relationship is opposite of Work-WorkVersion relationship. PublishVersions have database files, publishes don't. .. py:method:: check_destroy_permissions() Shortcut and wrapper for the check_permissions method. Returns: bool: True if the user has the permission to delete the publish, False otherwise. .. py:method:: check_owner_permissions(version_number=None) Shortcut and wrapper for the check_permissions method. This is a polymorphic method. version_number argument is not used in this method but an argument is required for the counterpart of the method in work object. Args: version_number (int, optional): This argument is not used in this method. .. py:method:: delete_version(version_number) Delete the given publish version. Args: version_number (int): The version number. Returns: tuple: (state(int), message(str)): 1 if the operation is successful, -1 otherwise. A message is returned as well. .. py:method:: destroy() Delete ALL PUBLISHES of the work. Use with caution. Returns: tuple: (state(int), message(str)): 1 if the operation is successful, -1 otherwise. A message is returned as well. .. py:method:: get_all_versions() Convenience method to get all versions with a forced scan. .. py:method:: get_last_version() Return the last publish version. .. py:method:: get_live_version() Get the live version among the published versions. .. py:method:: get_promoted_version() Get the promoted version among the published versions. .. py:method:: get_publish_data_folder() Return the publish data folder. .. py:method:: get_publish_project_folder() Return the publish scene folder. .. py:method:: get_version(version_number) Return the publish version. Args: version_number (int): The version number. .. py:method:: get_versions() Convenience method to get the versions with a forced scan. .. py:method:: import_bundle_piece(version_number, element_type, bundle_piece, ingestor_name, sequential=False) Import the bundled piece of the publish to the scene. This is a publish specific method. Args: version_number (int): The version number. element_type (str): The element type to import. ingestor (str, optional): The ingestor to use. Defaults to None. Raises: ValueError: If the element type is not given or not supported. .. py:method:: import_version(version_number, element_type=None, ingestor=None, sequential=False) Import the given version of the work to the scene. Args: version_number (int): The version number. element_type (str, optional): The element type to import. Defaults to None. ingestor (str, optional): The ingestor to use. Defaults to None. Raises: ValueError: If the element type is not given or not supported. .. py:method:: load_version(version_number, force=False, element_type='source', read_only=False) Load the publish version. Args: version_number (int): The version number. force (bool, optional): If True, loads the file without prompting for saving. Defaults to False. element_type (str, optional): The element type to load. Defaults to "source". read_only (bool, optional): Published files are write protected. If this argument is True, the file will be opened in read-only mode. If false, the file will be iterated as a new working version instead of opening the publish. Default is False. Raises: ValueError: If the element type is not found in the publish version. .. py:method:: omit() Omit the work. .. py:method:: reference_version(version_number, element_type=None, ingestor=None, sequential=False) Reference the given version of the work to the scene. Args: version_number (int): The version number. element_type (str, optional): The element type to reference. Defaults to None. ingestor (str, optional): The ingestor to use. Defaults to None. Raises: ValueError: If the element type is not given or not supported. .. py:method:: reload() Reload the publish object. .. py:method:: resurrect(dont_resurrect_versions=False) Resurrect the publishes stalk. By default this brings back the LAST publish version from purgatory. Args: dont_resurrect_versions (bool, optional): If True, the versions of the publish will not be resurrected. Defaults to False. Returns: tuple: (state(int), message(str)): 1 if the operation is successful, -1 otherwise. A message is returned as well. .. py:method:: revive() Revive the work. .. py:method:: scan_publish_versions() Return the publish versions in the publish folder. .. py:property:: all_versions All versions of the publish, including the deleted ones. .. py:property:: dcc Dcc of the publish. .. py:property:: dcc_handler DCC handler object. .. py:property:: deleted Return True if the publish is deleted. .. py:property:: live_version Return the live version. .. py:property:: name Publish name. .. py:attribute:: object_type .. py:property:: parent_task Parent task of the publish. .. py:property:: path Relative publish path. .. py:property:: promoted_version Return the promoted version. .. py:property:: publish_id Return the publish id of the publish. .. py:property:: state State of the publish. .. py:property:: version_count Number of publish versions. .. py:property:: versions Versions of the publish. .. py:data:: LOG