ILoadContext
#
- class ansys.tools.variableinterop.isave_context.ILoadContext#
Bases:
contextlib.AbstractContextManager
,abc.ABC
Defines an abstraction for a load medium.
This interface was defined to separate the concerns of being able to save large associated content in other transfer mediums. It allows out-of-bound data to be transferred. Examples include saving to a ZIP file or using an SCP side-channel on an SSH connection to send files or other large data objects.
Overview#
Import detail#
from ansys.tools.variableinterop.isave_context import ILoadContext
Method detail#
- ILoadContext.__exit__(__exc_type: Type[BaseException] | None, __exc_value: BaseException | None, __traceback: types.TracebackType | None) bool | None #
Raise any exception triggered within the runtime context.
- abstract ILoadContext.load_file(content_id: str | None) os.PathLike | None #
Load a file from the load medium.
The
ILoadContext
implementation decides how or when to send the actual data. SomeILoadContexts
implementations may merely collect metadata as part of this call and send the data on flush.- Parameters:
- content_id
Optional
[str
] ID generated by an equivalent
ISaveContext
instance to save a file into this context.
- content_id
- Returns:
Optional
[PathLike
]Path to the loaded file.