tik_manager4.objects.publish

Publish object module.

Attributes

LOG

Classes

Publish

Class to represent a publish.

Module Contents

class Publish(work_object)

Bases: 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.

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.

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.

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.

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.

get_all_versions()

Convenience method to get all versions with a forced scan.

get_last_version()

Return the last publish version.

get_live_version()

Get the live version among the published versions.

get_promoted_version()

Get the promoted version among the published versions.

get_publish_data_folder()

Return the publish data folder.

get_publish_project_folder()

Return the publish scene folder.

get_version(version_number)

Return the publish version.

Args:

version_number (int): The version number.

get_versions()

Convenience method to get the versions with a forced scan.

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.

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.

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.

omit()

Omit the work.

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.

reload()

Reload the publish object.

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.

revive()

Revive the work.

scan_publish_versions()

Return the publish versions in the publish folder.

property all_versions
All versions of the publish, including the deleted ones.
property dcc
Dcc of the publish.
property dcc_handler
DCC handler object.
property deleted
Return True if the publish is deleted.
property live_version
Return the live version.
property name
Publish name.
object_type
property parent_task
Parent task of the publish.
property path
Relative publish path.
property promoted_version
Return the promoted version.
property publish_id
Return the publish id of the publish.
property state
State of the publish.
property version_count
Number of publish versions.
property versions
Versions of the publish.
LOG