Select specific apps from config, or all if no labels specified.
(config: TortoiseConfig, app_labels: Iterable[str] | None)
| 189 | |
| 190 | |
| 191 | def _select_apps(config: TortoiseConfig, app_labels: Iterable[str] | None) -> dict[str, AppConfig]: |
| 192 | """Select specific apps from config, or all if no labels specified.""" |
| 193 | if not config.apps: |
| 194 | raise utils.CLIError("No apps configured in TORTOISE_ORM") |
| 195 | if not app_labels: |
| 196 | return dict(config.apps) |
| 197 | selected: dict[str, AppConfig] = {} |
| 198 | for label in app_labels: |
| 199 | if label not in config.apps: |
| 200 | raise utils.CLIUsageError(f"Unknown app label {label}") |
| 201 | selected[label] = config.apps[label] |
| 202 | return selected |
| 203 | |
| 204 | |
| 205 | def _group_apps_by_connection( |
no outgoing calls
no test coverage detected
searching dependent graphs…