erin.core package

Submodules

erin.core.exceptions module

exception erin.core.exceptions.CoreError[source]

Bases: Exception

Base exception class for Core modules and internal use

exception erin.core.exceptions.DatabaseError[source]

Bases: erin.core.exceptions.CoreError

Error raised when a database operation fails.

exception erin.core.exceptions.DatabaseKeyError(message)[source]

Bases: erin.core.exceptions.DatabaseError

Raised when an attempt to fetch from the key value store fails.

exception erin.core.exceptions.DatabaseTypeError(message)[source]

Bases: erin.core.exceptions.DatabaseError

Raised when parameters passed are incorrect.

exception erin.core.exceptions.EnvironmentVariableError(message)[source]

Bases: erin.core.exceptions.UserError

Error raised when an environment variable is not configured properly.

exception erin.core.exceptions.PluginError[source]

Bases: Exception

Base exception class for plugin errors

exception erin.core.exceptions.PluginNotFoundError(path, message=None)[source]

Bases: erin.core.exceptions.PluginError, FileNotFoundError

Raised when a plugin path is requested but doesn’t exist. Corresponds to errno ENOENT.

exception erin.core.exceptions.PrimaryKeyError(message)[source]

Bases: erin.core.exceptions.DatabaseError

Raised when there is either a primary key is missing or required.

exception erin.core.exceptions.RecordExistsError(message)[source]

Bases: erin.core.exceptions.DatabaseError

Raised when a record already exists.

exception erin.core.exceptions.TableNotFoundError(message)[source]

Bases: erin.core.exceptions.DatabaseError

Raised when a table is missing.

exception erin.core.exceptions.UserError[source]

Bases: Exception

Base exception class raised as a byproduct of misconfiguration

erin.core.loggers module

erin.core.loggers.get_hypercorn_logger(log_level: str) → dict[source]

erin.core.schema module

erin.core.utils module

erin.core.utils.config_loader(mappings, optional_envs)[source]
erin.core.utils.find_plugins(package) → List[str][source]

Finds all top level subpackages in a package and presents them in the format required by discord.ext.cli.Bot.load_extension().

This is useful when you need to load cogs from multiple areas of your bot. Simply convert your cogs directory into a package and run this method on it.

Parameters:package (package) – Your package as a python package or a path to one. Note: All packages are modules, all modules are not packages.
Returns:A list of strings of format foo.bar as required by discord.ext.cli.Bot.load_extension(). If package passed is not valid then None is returned instead.
Return type:list or None
erin.core.utils.get_plugin_data(plugin)[source]

Retrieve the plugin_data dictionary defined in a plugin. :param plugin: :type plugin: path to a plugin in module import format

Returns:The plugin_data dict defined in a plugin or None if the dict is not defined.
Return type:dict or None

Module contents