Skip to content

StoragePaths

StoragePaths #

Bases: Service

Note

Its methods are not supported on web.

data #

data: Any = skip_field()

Arbitrary data of any type.

key #

key: (
    str | int | float | bool | ValueKey | ScrollKey | None
) = None

page #

page: Page | PageView | None

The page (of type Page or PageView) to which this control belongs to.

parent #

parent: BaseControl | None

The direct ancestor(parent) of this control.

It defaults to None and will only have a value when this control is mounted (added to the page tree).

The Page control (which is the root of the tree) is an exception - it always has parent=None.

before_event #

before_event(e: ControlEvent)

before_update #

before_update()

This method is called every time when this control is being updated.

Note

Make sure not to call/request an update() here.

did_mount #

did_mount()

get_application_cache_directory_async #

get_application_cache_directory_async() -> str

Returns the path to the application-specific cache directory.

If this directory does not exist, it is created automatically.

RETURNS DESCRIPTION
str

The path to a directory where the application may place cache files.

RAISES DESCRIPTION
FletUnsupportedPlatformException

If called on the web platform.

get_application_documents_directory_async #

get_application_documents_directory_async() -> str

Returns the path to a directory for user-generated data.

This directory is intended for data that cannot be recreated by your application.

For non-user-generated data, consider using:

RAISES DESCRIPTION
FletUnsupportedPlatformException

If called on the web platform.

RETURNS DESCRIPTION
str

The path to the application documents directory.

get_application_support_directory_async #

get_application_support_directory_async() -> str

Returns the path to a directory for application support files.

This directory is created automatically if it does not exist. Use this for files not exposed to the user. Do not use for user data files.

RAISES DESCRIPTION
FletUnsupportedPlatformException

If called on the web platform.

RETURNS DESCRIPTION
str

The path to the application support directory.

get_console_log_filename_async #

get_console_log_filename_async() -> str

Returns the path to a console.log file for debugging.

This file is located in the application cache directory.

RAISES DESCRIPTION
FletUnsupportedPlatformException

If called on the web platform.

RETURNS DESCRIPTION
str

The path to the console log file.

get_downloads_directory_async #

get_downloads_directory_async() -> str | None

Returns the path to the downloads directory.

The returned directory may not exist; clients should verify and create it if necessary.

RAISES DESCRIPTION
FletUnsupportedPlatformException

If called on the web platform.

RETURNS DESCRIPTION
str | None

The path to the downloads directory, or None if unavailable.

get_external_cache_directories_async #

get_external_cache_directories_async() -> list[str] | None

Returns paths to external cache directories.

These directories are typically on external storage (e.g., SD cards). Multiple directories may be available on some devices.

RAISES DESCRIPTION
FletUnsupportedPlatformException

If called on the web or non-Android platforms.

RETURNS DESCRIPTION
list[str] | None

A List of external cache directory paths, or None if unavailable.

get_external_storage_directories_async #

get_external_storage_directories_async() -> (
    list[str] | None
)

Returns paths to external storage directories.

These directories are typically on external storage (e.g., SD cards). Multiple directories may be available on some devices.

RAISES DESCRIPTION
FletUnsupportedPlatformException

If called on the web or non-Android platforms.

RETURNS DESCRIPTION
list[str] | None

A List of external storage directory paths, or None if unavailable.

get_external_storage_directory_async #

get_external_storage_directory_async() -> str | None

Returns the path to the top-level external storage directory.

RAISES DESCRIPTION
FletUnsupportedPlatformException

If called on the web or non-Android platforms.

RETURNS DESCRIPTION
str | None

The path to the external storage directory, or None if unavailable.

get_library_directory_async #

get_library_directory_async() -> str

Returns the path to the library directory.

This directory is for persistent, backed-up files not visible to the user (e.g., sqlite.db).

RAISES DESCRIPTION
FletUnsupportedPlatformException

If called on the web or non-Apple platforms.

RETURNS DESCRIPTION
str

The path to the library directory.

get_temporary_directory_async #

get_temporary_directory_async() -> str

Returns the path to the temporary directory.

This directory is not backed up and is suitable for storing caches of downloaded files. Files may be cleared at any time. The caller is responsible for managing files within this directory.

RAISES DESCRIPTION
FletUnsupportedPlatformException

If called on the web platform.

RETURNS DESCRIPTION
str

The path to the temporary directory.

init #

init()

is_isolated #

is_isolated()

update #

update() -> None

will_unmount #

will_unmount()