vikit.common.context_managers

Overview

Classes

WorkingFolderContext

This class is a context manager to change the working directory to the one specified

Classes

class vikit.common.context_managers.WorkingFolderContext(root=None, mark: str = 'mark', include_mark=True, include_caller_stack=False, insert_date=True, insert_minutes=True, date_format='%Y-%m-%d', insert_small_id=True)

This class is a context manager to change the working directory to the one specified by the constructor parameters.

WARNING: Not thread safe. This class it is meant to be used in a synchronous context or by launching several ones in separate processes as we change directory in the process.

Overview

Methods

get_delivery_folder_suffix()

Get a unique delivery folder.

Members

get_delivery_folder_suffix() str

Get a unique delivery folder.

Returns:

A unique folder name without the root folder path. For example, if the full path is /root_folder/2024-01-01-12-00-1234567890-MyMark, this method will return 2024-01-01-12-00-1234567890-MyMark.