ILoadContext ============ .. py:class:: ILoadContext :canonical: ansys.tools.variableinterop.isave_context.ILoadContext Bases: :py:obj:`contextlib.AbstractContextManager`, :py:obj:`abc.ABC` Defines an abstraction for a load medium. Overview -------- .. py:currentmodule:: ILoadContext .. tab-set:: .. tab-item:: Abstract methods .. list-table:: :header-rows: 0 :widths: auto * - :py:attr:`~load_file` - Load a file from the load medium. * - :py:attr:`~flush` - Flush any changes in the context to the underlying stream or file. * - :py:attr:`~close` - Close the context. .. tab-item:: Special methods .. list-table:: :header-rows: 0 :widths: auto * - :py:attr:`~__exit__` - Raise any exception triggered within the runtime context. Import detail ------------- .. code-block:: python from ansys.tools.variableinterop.isave_context import ILoadContext Method detail ------------- .. py:method:: __exit__(__exc_type: Type[BaseException] | None, __exc_value: BaseException | None, __traceback: types.TracebackType | None) -> bool | None Raise any exception triggered within the runtime context. .. !! processed by numpydoc !! .. py:method:: load_file(content_id: Optional[str]) -> Optional[os.PathLike] :abstractmethod: Load a file from the load medium. The ``ILoadContext`` implementation decides how or when to send the actual data. Some ``ILoadContexts`` implementations may merely collect metadata as part of this call and send the data on flush. :Parameters: **content_id** : :obj:`Optional`\[:class:`python:str`] ID generated by an equivalent ``ISaveContext`` instance to save a file into this context. :Returns: :obj:`Optional`\[:obj:`PathLike`] Path to the loaded file. .. !! processed by numpydoc !! .. py:method:: flush() -> None :abstractmethod: Flush any changes in the context to the underlying stream or file. .. !! processed by numpydoc !! .. py:method:: close() -> None :abstractmethod: Close the context. .. !! processed by numpydoc !!