_status module#

class cache_manager._status.Status(value)[source]#

Class defining the status for cache items.

Arg:

Integer defining current status as described above.

Returns:

Instance of Status with the specified status value provided.

Attrs:
UNINITIALIZED:

Has value 0. Newly created entry, to be initialized.

WRITE:

Has value 1. Information currently being written on the item.

FAILED:

Has value 2. Something went wrong.

READY:

Has value 3. Entry is ready/initialized and not under writing.

TRASH:

Has value -1. Entry is to be deleted but can be recovered, file still exists.

DELETED:

Has value -2. File is deleted and entry is marked for deletion.

Example:
>>> Status(1)
<Status.WRITE: 1>
>>> Status.WRITE
<Status.WRITE: 1>
classmethod from_str(name)[source]#

Creates an instance of Status based on the passed status string instead of the integer.

Return type

Status

Arg:
name:

String defining the status. Not case-sensitive.

Returns:

Instance of Status with the specified status value provided.

Example:
>>> Status('WRITE')
<Status.WRITE: 1>
>>> Status('ready')
<Status.READY: 3>