Tag#

class Tag(json_file_path)#

Bases: object

Class which represents a CATMA tag.

Parameters

json_file_path (str) – The path of the tag within the project’s folder structure.

Raises

FileNotFoundError – If the json_file_path could not be found.

SYSTEM_PROPERTY_UUID_CATMA_MARKUPTIMESTAMP = 'CATMA_54A5F93F-5333-3F0D-92F7-7BD5930DB9E6'#
SYSTEM_PROPERTY_UUID_CATMA_MARKUPAUTHOR = 'CATMA_AB27F1D4-303A-3622-BB2C-72C310D0C1BF'#
path: str#

The tag’s path.

name: str#

The tag’s name.

id: str#

The tag’s UUID.

parent_id: str#

The parent tag’s UUID.

properties_data: list#

The tag’s properties as a list of dictionaries.

properties: List[gitma.property.Property]#

The tag’s properties as list of gitma.Property objects.

properties_dict: Dict[str, gitma.property.Property]#

Dictionary with the names of properties as keys and gitma.Propety objects as values.

color#

The color defined for the tag in the CATMA UI

child_tags: List[gitma.tag.Tag]#

List of child tags as gitma.Tag objects. Is an empty list until gitma.Tag.get_child_tags is used.

parent: gitma.tag.Tag#

Parent tag as a gitma.Tag object. Is None until gitma.Tag.get_parent_tag is used.

full_path: str#

The full tag path within the tagset.

get_parent_tag(tagset_dict)#

Adds the parent tag to self.parent.

Parameters

tagset_dict (dict) – The tagset as a gitma.Tagset.tag_dict.

get_child_tags(tags)#

Adds all child tags to self.child_tags.

Parameters

tags (list) – A list of gitma.Tag objects.

full_tag_path()#
rename_property(old_prop, new_prop)#

Renames a property of the tag by overwriting its JSON.

Parameters
  • old_prop (str) – The old property’s name.

  • new_prop (str) – The new proeprty’s name.

rename_possible_property_value(prop, old_value, new_value)#

Renames a specified property value in the list of possible property values.

Parameters
  • prop (str) – The property’s name.

  • old_value (str) – The property value to be replaced.

  • new_value (str) – The new property value.