vikit.common.context_managers ============================= .. py:module:: vikit.common.context_managers Overview -------- .. list-table:: Classes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`WorkingFolderContext ` - This class is a context manager to change the working directory to the one specified Classes ------- .. py:class:: 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. .. rubric:: Overview .. list-table:: Methods :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`get_delivery_folder_suffix `\ () - Get a unique delivery folder. .. rubric:: Members .. py:method:: 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`.