Config
config ¶
Handling the configuration for all adapters
DEFAULT_CFG = f'# Configuration for Ultimate Notion\n#\n# * Non-absolute paths are always relative to the directory of this file.\n# * You can use environment variables in the format ${{env:VAR_NAME}} or ${{env:VAR_NAME|DEFAULT_VALUE}}.\n\n[ultimate_notion]\nsync_state_dir = "sync_states"\ndebug = "${{env:{ENV_ULTIMATE_NOTION_DEBUG}|false}}"\ntoken = "${{env:{ENV_NOTION_TOKEN}}}"\n\n[google]\nclient_secret_json = "client_secret.json"\ntoken_json = "token.json"\n' module-attribute ¶
DEFAULT_ULTIMATE_NOTION_CFG_PATH: str = '.ultimate-notion/config.toml' module-attribute ¶
Default path within $HOME to the configuration file of Ultimate Notion
ENV_NOTION_TOKEN = 'NOTION_TOKEN' module-attribute ¶
Name of the environment variable to look up the Notion token
ENV_ULTIMATE_NOTION_CFG: str = 'ULTIMATE_NOTION_CONFIG' module-attribute ¶
Name of the environment variable to look up the path for the config
ENV_ULTIMATE_NOTION_DEBUG = 'ULTIMATE_NOTION_DEBUG' module-attribute ¶
Config ¶
Main configuration object.
GoogleCfg ¶
UNOCfg ¶
activate_debug_mode() -> None ¶
Activates debug mode by setting up logging and notifying the user.
get_cfg() -> Config ¶
Returns the configuration as an object.
get_cfg_file() -> Path ¶
Determines the path of the config file.
get_or_create_cfg() -> Config ¶
Returns the configuration as an object or creates it if it doesn't exist yet.
resolve_env_value(value: str) -> str ¶
Resolves environment variable values in the format ${env:VAR_NAME|DEFAULT_VALUE}.