toktokkie.metadata.base.components package

Submodules

toktokkie.metadata.base.components.JsonComponent module

class toktokkie.metadata.base.components.JsonComponent.JsonComponent

Bases: object

Specifies common features of metadata components

property json

Converts the component into a JSON-compatible dictionary :return: The JSON-compatible dictionary

logger = <Logger toktokkie.metadata.base.components.JsonComponent (WARNING)>

Logger for the components

toktokkie.metadata.base.components.RenameOperation module

class toktokkie.metadata.base.components.RenameOperation.RenameOperation(source_path: str, new_name: str)

Bases: object

Class that models a renaming operation

__init__(source_path: str, new_name: str)

Initializes the RenameOperation object :param source_path: The currently existing path to the file/directory :param new_name: The new name of the file/directory

rename()

Renames the episode file to the new name :return: None

static sanitize(parent: str, filename: str) → str

Replaces all illegal file system characters with valid ones. Also, limits the length of the resulting file path to 250 characters, if at all possible :param parent: The parent directory :param filename: The filename to sanitize :return: The sanitized string

Module contents