(item: MenuItem)
| 33 | |
| 34 | async def save_config(config: ArchConfig) -> None: |
| 35 | def preview(item: MenuItem) -> str | None: |
| 36 | match item.value: |
| 37 | case 'user_config': |
| 38 | serialized = config.user_config_to_json() |
| 39 | return f'{USER_CONFIG_FILE}\n{serialized}' |
| 40 | case 'user_creds': |
| 41 | if maybe_serial := config.user_credentials_to_json(): |
| 42 | return f'{USER_CREDS_FILE}\n{maybe_serial}' |
| 43 | return tr('No configuration') |
| 44 | case 'all': |
| 45 | output = [str(USER_CONFIG_FILE)] |
| 46 | config.user_credentials_to_json() |
| 47 | output.append(str(USER_CREDS_FILE)) |
| 48 | return '\n'.join(output) |
| 49 | return None |
| 50 | |
| 51 | items = [ |
| 52 | MenuItem( |
nothing calls this directly
no test coverage detected