tik_manager4.objects.version ============================ .. py:module:: tik_manager4.objects.version .. autoapi-nested-parse:: Work and Publish objects. Attributes ---------- .. autoapisummary:: tik_manager4.objects.version.LOG Classes ------- .. autoapisummary:: tik_manager4.objects.version.LiveVersion tik_manager4.objects.version.PromotedVersion tik_manager4.objects.version.PublishVersion tik_manager4.objects.version.WorkVersion Module Contents --------------- .. py:class:: LiveVersion(absolute_path, name=None, path=None, live_object=None, promoted_object=None) Bases: :py:obj:`PublishVersion` Customized PublishVersion object class. .. py:method:: get_display_color() Return the display color of the version. Returns: str: The display color of the publish version. .. py:method:: get_resolved_path(*args) Override the get_resolved_path method to return the path. .. py:method:: is_live() Override the is_live method to always return True. .. py:method:: is_promoted() Override the is_promoted method to always return False. This is to prevent doubling the promoted publish version. .. py:property:: nice_name Override the nice_name property to return the name of the publish version. .. py:attribute:: object_type .. py:attribute:: promote_class :value: False .. py:property:: version Override the version property to return 0. .. py:class:: PromotedVersion(absolute_path, name=None, path=None, live_object=None, promoted_object=None) Bases: :py:obj:`PublishVersion` Customized PublishVersion object class. .. py:method:: can_promote() Override the can_promote method to always return False. .. py:method:: get_display_color() Return the display color of the version. Returns: str: The display color of the publish version. .. py:method:: get_resolved_path(*args) Override the get_resolved_path method to return the path. .. py:method:: is_live() Override the is_live method to always return False. .. py:method:: is_promoted() Override the is_promoted method to always return False. This is to prevent doubling the promoted publish version. .. py:method:: promote() Override the promote method to do nothing. .. py:property:: nice_name Override the nice_name property to return the name of the publish version. .. py:attribute:: object_type .. py:attribute:: promote_class :value: True .. py:property:: version Override the version property to return 0. .. py:class:: PublishVersion(absolute_path, name=None, path=None, live_object=None, promoted_object=None) Bases: :py:obj:`tik_manager4.core.settings.Settings`, :py:obj:`tik_manager4.mixins.localize.LocalizeMixin` PublishVersion object class. This class handles the publish version objects. Unlike work versions, publish versions are directly represented by files. name and path properties are required during first creation. When read from the file, these properties are initialized from the file. .. py:method:: can_promote() Check if the publish version can be promoted. .. py:method:: get_creation_date() Return the creation time of the publish version file. .. py:method:: get_display_color() Return the display color of the version. Returns: str: The display color of the publish version. .. py:method:: get_element_by_type(element_type) Return the element by the given type. Args: element_type (str): The type of the element. Returns: dict: The element or None if not found. .. py:method:: get_element_path(element_type, relative=True) Return the element path of the given element type. Args: element_type (str): The type of the element. relative (bool, optional): If True, returns the relative path. If False, returns the absolute path. Default is True. Returns: str: The path of the element or None if not found. .. py:method:: get_element_suffix(element_type) Return the element suffix of the given element type. Args: element_type (str): The type of the element. Returns: str: The suffix of the element or None if not found. .. py:method:: get_modified_date() Return the modified time of the publish version file. .. py:method:: init_properties() Initialize the properties of the publish. .. py:method:: is_deleted() Convenience method to check if the publish version is deleted. .. py:method:: is_element_bundled(element_type) Return if the element is bundled or not. Args: element_type (str): The type of the element. Returns: bool: True if the element is bundled, False otherwise. .. py:method:: is_live() Check if the publish version is a live version. .. py:method:: is_promoted() Return if the publish is promoted or not. This method checks the 'promoted' file in the publish folder. If the content is matching with the publish id, return True .. py:method:: make_live() Make the publish version a live version. .. py:method:: move_to_purgatory() Move the publish version to the purgatory folder. .. py:method:: promote() Promote the publish editing the promoted.json. .. py:method:: resurrect() Bring back the publish version from purgatory. .. py:method:: to_dict() Convert the WorkVersion object to a dictionary. .. py:property:: category The category of the publish version. .. py:property:: creator The creator of the publish version. .. py:property:: dcc The dcc of the publish version. .. py:property:: dcc_handler DCC handler object. .. py:property:: dcc_version Dcc version used while publishing the version. .. py:property:: deleted The deleted status of the publish version. .. py:property:: element_mapping The element mapping of the publish version. Element mapping is a dictionary where each key is the element name and the value is the element type. .. py:property:: element_types The element types of the publish version. .. py:property:: elements The elements of the publish version. .. py:property:: nice_name Return the nice name of the publish version. .. py:property:: notes Notes of the publish version. .. py:attribute:: object_type .. py:property:: previews The previews of the publish version. .. py:attribute:: promote_class :value: False .. py:property:: publish_id Unique id of the publish version. .. py:property:: relative_path Relative path of the publish version. .. py:property:: software_version Dcc version used while publishing the version. Identical to dcc_version property. .. py:property:: task_id Task id of the publish version. .. py:property:: task_name Task name of the publish version. .. py:property:: thumbnail Thumbnail of the publish version. .. py:property:: user The user of the publish version. Alias for creator. .. py:property:: version Number of the publish version. .. py:class:: WorkVersion(parent_path, data_dictionary, parent_work) Bases: :py:obj:`tik_manager4.mixins.localize.LocalizeMixin` WorkVersion object class. Work versions are not directly represented by files. They are stored in the main work database. .. py:method:: from_dict(dictionary) Apply the values from given dictionary. .. py:method:: get_creation_date() Return the creation time of the work version. .. py:method:: get_display_color() Return the display color of the version. Returns: str: The display color of the publish version. .. py:method:: get_modified_date() Return the modified time of the work version. .. py:method:: move_to_purgatory() Move the work version to the purgatory folder. .. py:method:: resurrect() Bring back the work version from purgatory. .. py:method:: to_dict() Convert the WorkVersion object to a dictionary. .. py:property:: dcc_version The dcc version of the work version. .. py:property:: deleted The deleted status of the work version. .. py:property:: file_format The file format of the work version. .. py:property:: nice_name Return the nice name of the work version. .. py:property:: notes The notes of the work version. .. py:attribute:: object_type .. py:property:: path The relative path of the work version. .. py:property:: previews The previews of the work version. .. py:property:: scene_path The scene path of the work version. .. py:property:: thumbnail The thumbnail path of the work version. .. py:property:: user The user of the work version. .. py:property:: version The version number of the work version. .. py:property:: workstation The workstation of the work version. .. py:data:: LOG