tik_manager4.objects.task

Module for Task object.

Attributes

LOG

Classes

Task

Task object to handle works and publishes.

Module Contents

class Task(absolute_path, name=None, categories=None, path='', file_name=None, parent_sub=None, task_id=None, metadata_overrides=None)

Bases: tik_manager4.core.settings.Settings, tik_manager4.objects.entity.Entity

Task object to handle works and publishes.

Task objects are getting populated by the subproject objects. All the task settings are stored in the task settings file. During the initial instantiation, the optional arguments are used to create the settings file if it does not exist.

add_category(category)

Add a category to the task.

Args:

category (str): Category name

Returns:

Category: The category object

build_categories(category_list)

Create category objects.

Builds a dictionary of category objects from a list of category names. Does NOT create folders or apply settings.

Args:

category_list (list): List of category names

Returns:

dict: Dictionary of categories

delete_category(category)

Delete a category from the task.

Args:

category: (str) Category to delete

Returns:

int: 1 if successful, -1 if failed

destroy()

Destroy the task, deleting all categories and everything in them.

edit(nice_name=None, categories=None, metadata_overrides=None, uid=None)

Edit the task.

Edits the given arguments of the task and applies the settings. If no argument is given, the function does nothing. This method requires level 2 permissions.

Args:

nice_name (str): New name for the task task_type (str): New type for the task categories (list): New categories for the task

Returns:

int: 1 if successful, -1 if failed

find_works_by_wildcard(wildcard)

Search for works by wildcard among all categories.

Args:

wildcard: (str) Wildcard to search

Returns:

list: List of works that match the wildcard

is_empty()

Check all categories and return True if all are empty.

omit()

Omit the task.

order_categories(new_order)

Order the categories of the task.

Args:

new_order: (list) Categories with new order

Returns:

int: 1 if successful, -1 if failed

refresh()

Refresh the task object.

resurrect()

Resurrect the task. Make sure the parent sub (and everything above) is not deleted.

revive()

Revive the task.

property categories
Return available categories Dictionary.
property creator
Creator of the task.
property deleted
Deleted state of the task.
property file_name
File Name of the task settings file.
property id
Unique ID of the task.
property metadata
Metadata of the task.
property name
Name of the task.
property nice_name
Nice name of the task.
object_type
property parent_sub
Parent sub of the task.
property state
State of the task.
property type
Type of the task.
LOG