Read [tui] section to preserve BC
This commit is contained in:
parent
9f0c94bce1
commit
11bc102cc8
|
@ -8,6 +8,7 @@ from click.testing import Result
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from toot import App, User, config, __version__
|
from toot import App, User, config, __version__
|
||||||
from toot.settings import get_settings
|
from toot.settings import get_settings
|
||||||
|
from toot.output import print_warning
|
||||||
|
|
||||||
if t.TYPE_CHECKING:
|
if t.TYPE_CHECKING:
|
||||||
import typing_extensions as te
|
import typing_extensions as te
|
||||||
|
@ -47,6 +48,14 @@ def get_default_map():
|
||||||
settings = get_settings()
|
settings = get_settings()
|
||||||
common = settings.get("common", {})
|
common = settings.get("common", {})
|
||||||
commands = settings.get("commands", {})
|
commands = settings.get("commands", {})
|
||||||
|
|
||||||
|
# TODO: remove in version 1.0
|
||||||
|
tui_old = settings.get("tui", {})
|
||||||
|
if tui_old:
|
||||||
|
print_warning("Settings section [tui] has been deprecated in favour of [commands.tui].")
|
||||||
|
tui_new = commands.get("tui", {})
|
||||||
|
commands["tui"] = {**tui_old, **tui_new}
|
||||||
|
|
||||||
return {**common, **commands}
|
return {**common, **commands}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue