mini_apps.settings

class mini_apps.settings.AppSettings(data, global_settings)

Bases: SettingsValue

Access both app-specific and global settings

class mini_apps.settings.LogSource(name)

Bases: object

Class to simplify logging

class mini_apps.settings.Settings(data: dict)

Bases: SettingsValue

Global settings

connect_database()

Connects to the database and initializes the models

import_class(import_string: str)

Imports a python class from its module.class notation

load_app(app_settings: dict, name: str)

Loads a mini app / bot

load_database(db_settings: dict)

Loads database settings

classmethod load_global(fallback=False)

Loads the global settings file

Parameters:

fallback – If True, it will load a minimal default configuration without raising errors

websocket_server(host=None, port=None)

Returns a WebsocketServer instance based on settings

class mini_apps.settings.SettingsValue(data: dict = {})

Bases: object

Object to access settings in a more convenient way than a dict

get(key: str, default=None)

Get an item or the default value if not present

classmethod load(filename, **extra)

Loads settings from a JSON file

pop(key: str)

Removes a setting and returns its value