(cfg: _ThemeToml, name: str)
| 361 | |
| 362 | |
| 363 | def _validate_theme_toml(cfg: _ThemeToml, name: str) -> str: |
| 364 | if 'theme' not in cfg: |
| 365 | msg = __('theme %r doesn\'t have the "theme" table') % name |
| 366 | raise ThemeError(msg) |
| 367 | theme = cfg['theme'] |
| 368 | if not isinstance(theme, dict): |
| 369 | msg = __('The %r theme "[theme]" table is not a table') % name |
| 370 | raise ThemeError(msg) |
| 371 | inherit = theme.get('inherit', '') |
| 372 | if not inherit: |
| 373 | msg = __('The %r theme must define the "theme.inherit" setting') % name |
| 374 | raise ThemeError(msg) |
| 375 | if 'options' in cfg: |
| 376 | if not isinstance(cfg['options'], dict): |
| 377 | msg = __('The %r theme "[options]" table is not a table') % name |
| 378 | raise ThemeError(msg) |
| 379 | return inherit |
| 380 | |
| 381 | |
| 382 | def _convert_theme_toml(cfg: _ThemeToml, /) -> _ConfigFile: |
no test coverage detected
searching dependent graphs…