AlreadyLocalFileContentContext#

class AlreadyLocalFileContentContext(local_content_path: anyio.Path | None = None)#

Bases: LocalFileContentContext, AsyncLocalFileContentContext

Provides a default local file context for when the file is already hosted locally.

Overview#

keep_file_on_exit

Call this method before exiting to prevent deleting the file on exit.

content_path

Get the local path to the content.

__exit__

Exit the context.

__aexit__

Asynchronously exit the context.

Import detail#

from ansys.tools.variableinterop.file_value import AlreadyLocalFileContentContext

Property detail#

property AlreadyLocalFileContentContext.content_path: os.PathLike | None#

Get the local path to the content.

Method detail#

AlreadyLocalFileContentContext.keep_file_on_exit() None#

Call this method before exiting to prevent deleting the file on exit.

AlreadyLocalFileContentContext.__exit__(exc_type, exc_val, exc_tb) None#

Exit the context.

This does nothing as no additional temporary file was created.

async AlreadyLocalFileContentContext.__aexit__(exc_type, exc_val, exc_tb) None#

Asynchronously exit the context.

This does nothing as no additional temporary file was created.