core: Replace legacy INI config system with Pydantic-based TOML configuration.

This is a huge configuration refactoring.

The configuration system now uses Pydantic settings, with better validation, better
support for environment variables and other goodies.

The main config files now use TOML instead of INI, this allow for better handling of
complex types, notably dict.

Plugins, components and frontends can declare their config settings in a class which will
be imported dynamically.
This commit is contained in:
Goffi 2025-11-30 12:27:35 +01:00
commit 6a7b7bc36a

View file

@ -770,7 +770,7 @@ class Edit(base.CommandBase, BlogPublishCommon, common.BaseEdit):
async def start(self):
# if there are user defined extension, we use them
SYNTAX_EXT.update(
config.config_get(self.sat_conf, C.CONFIG_SECTION, CONF_SYNTAX_EXT, {})
self.host.cli_settings.syntax_ext
)
self.current_syntax = await self.get_current_syntax()
@ -948,24 +948,17 @@ class Preview(base.CommandBase, common.BaseEdit):
else:
aionotify = None
sat_conf = self.sat_conf
SYNTAX_EXT.update(
config.config_get(sat_conf, C.CONFIG_SECTION, CONF_SYNTAX_EXT, {})
self.host.cli_settings.syntax_ext
)
try:
self.open_cb_cmd = config.config_get(
sat_conf, C.CONFIG_SECTION, "blog_preview_open_cmd", Exception
)
except (NoOptionError, NoSectionError):
self.open_cb_cmd = None
self.open_cb_cmd = self.cli_settings.blog_preview_open_cmd
if self.open_cb_cmd is None:
open_cb = self.show_preview
else:
open_cb = self.open_preview_ext
open_cp = self.open_preview_ext
self.update_cb_cmd = config.config_get(
sat_conf, C.CONFIG_SECTION, "blog_preview_update_cmd", self.open_cb_cmd
)
self.update_cb_cmd = self.cli_settings.blog_preview_update_cmd
if self.update_cb_cmd is None:
update_cb = self.show_preview
else: