czech_plus.utils#

Module for utils.

Some of those will be run in czech_plus. Some will be used in other places.

Module Contents#

Classes#

Singleton

Metaclass to do Singleton pattern.

Functions#

setup_logging(→ None)

Setup logging for the addon.

assert_that(→ None)

By default, Anki removes all asserts from the code, so we need to craft own assert.

setup_logging() None[source]#

Setup logging for the addon.

class Singleton[source]#

Bases: type

Metaclass to do Singleton pattern.

_instances: dict[type, Any][source]#
__call__(*args, **kwargs)[source]#

Actual logic in this class.

See https://stackoverflow.com/a/6798042.

assert_that(statement: bool, msg: str = '', /) None[source]#

By default, Anki removes all asserts from the code, so we need to craft own assert.

Example

assert next(generator) == str  # if this statement will not be executed - everything will fail.