MCPcopy Create free account
hub / github.com/archlinux/archinstall / preview

Function preview

archinstall/lib/configuration.py:35–49  ·  view source on GitHub ↗
(item: MenuItem)

Source from the content-addressed store, hash-verified

33
34async 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(

Callers

nothing calls this directly

Calls 3

trFunction · 0.90
user_config_to_jsonMethod · 0.80

Tested by

no test coverage detected