DAF control reference#
- async daf.core.initialize(user_callback: Callable | Coroutine | None = None, debug: TraceLEVELS | int | str | None = TraceLEVELS.NORMAL, logger: LoggerBASE | None = None, accounts: List[ACCOUNT] | None = None, save_to_file: bool = False, remote_client: RemoteAccessCLIENT | None = None) None #
The main initialization function. It initializes all the other modules, creates advertising tasks and initializes all the core functionality. If you want to control your own event loop, use this instead of run.
Any (Any) – Parameters are the same as in
- daf.core.run(user_callback: Callable | Coroutine | None = None, debug: TraceLEVELS | int | str | bool | None = TraceLEVELS.NORMAL, logger: LoggerBASE | None = None, accounts: List[ACCOUNT] | None = None, save_to_file: bool = False, remote_client: RemoteAccessCLIENT | None = None) None #
Changed in version 2.7: Removed deprecated parameters (see v2.7)
Runs the framework and does not return until the framework is stopped (
daf.core.shutdown()). After stopping, it returns None.
This will block until the framework is stopped, if you want manual control over the asyncio event loop, eg. you want to start the framework as a task, use the
user_callback (Optional[Union[Callable, Coroutine]]) – Function or async function to call after the framework has been started.
Changed in version v2.3: Deprecate use of bool (assume TraceLEVELS.NORMAL). Add support for TraceLEVELS or int or str that converts to TraceLEVELS.
The level of trace for trace function to display. The higher value this option is, the more will be displayed.
logger (Optional[loggers.LoggerBASE]) – The logging class to use. If this is not provided, JSON is automatically used with the
pathparameter set to /<user-home-dir>/daf/History
save_to_file (Optional[bool]) –
True, the shilling list (of accounts, guilds, messages, …) will be saved to file and preserved on shutdown.
Setting this to True and passing the
accountsparameter as well, results in Account already added warnings.