Utilities¶
- ehforwarderbot.utils.extra(name, desc)[source]¶
Decorator for slave channel’s “additional features” interface.
- Parameters
- Return type
- Returns
The decorated method.
Example
@extra(name="Echo", desc="Return the text entered.\n\nUsage:\n {function_name} text") def echo(self, text: str) -> Optional[str]: return text
- ehforwarderbot.utils.get_base_path()[source]¶
Get the base data path for EFB. This can be defined by the environment variable
EFB_DATA_PATH
.If
EFB_DATA_PATH
is not defined, this gives~/.ehforwarderbot
.This method creates the queried path if not existing.
- Return type
- Returns
The base path.
- ehforwarderbot.utils.get_config_path(module_id=None, ext='yaml')[source]¶
Get path for configuration file. Defaulted to
~/.ehforwarderbot/profiles/profile_name/module_id/config.yaml
.This method creates the queried path if not existing. The config file will not be created, however.
- ehforwarderbot.utils.get_custom_modules_path()[source]¶
Get the path to custom channels
- Return type
- Returns
The path for custom channels.