Skip to content

Types

Cacher

Cacher(cache_dirpath)

The caching management class.

Parameters
Parameter Default Description
cache_dirpath
str
required

The path to the directory with the cache.

var

var(name, default, *, group='main')

Caching a variable, wraps the value of the variable in property and saves it when the value is changed, and the next time SeaPlayer is started, the value is loaded from the cache.

Parameters
Parameter Default Description
name
str
required

The name of the cached variable.

default
D
required

The default value of the variable.

group
str
'main'

A group of variables. Defaults to "main".

Returns
Name Type Description
D D

Returns property, but as part of convenience, typing has been done that says that the same type that was set is returned.

Converter

Converter(*args, **kwargs)

A class for converting values entered by the user.

boolean staticmethod

boolean(value)

Converting to bool.

filepath staticmethod

filepath(value)

Check if there is a file on the path.

Parameters
Parameter Default Description
value
str
required

The value entered by the user.

Raises
Type Description
PathNotExistsError

Called if the path does not point to a non-existent file.

Returns
Name Type Description
str str

The path to the file.

optional staticmethod

optional(tp)

This is a type or function decorator for converting a value.

path staticmethod

path(value)

Checking the existence of a path.

Parameters
Parameter Default Description
value
str
required

The value entered by the user.

Raises
Type Description
PathNotExistsError

Called if the path does not point to a non-existent file or directory.

Returns
Name Type Description
str str

The path to the file or directory.