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

Class ProfileConfiguration

archinstall/lib/models/profile.py:20–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19@dataclass
20class ProfileConfiguration(SubConfig):
21 profile: Profile | None = None
22 gfx_driver: GfxDriver | None = None
23 greeter: GreeterType | None = None
24
25 @override
26 def json(self) -> _ProfileConfigurationSerialization:
27 from archinstall.lib.profile.profiles_handler import profile_handler
28
29 return {
30 'profile': profile_handler.to_json(self.profile),
31 'gfx_driver': self.gfx_driver.value if self.gfx_driver else None,
32 'greeter': self.greeter.value if self.greeter else None,
33 }
34
35 @override
36 def summary(self) -> list[str] | None:
37 out: list[str] = []
38
39 if self.profile:
40 out.append(self.profile.name)
41
42 if self.gfx_driver:
43 out.append(tr('{} graphics driver').format(self.gfx_driver.value))
44
45 if self.greeter:
46 out.append(tr('{} greeter').format(self.greeter.value))
47
48 return out
49
50 return None
51
52 @classmethod
53 def parse_arg(cls, arg: _ProfileConfigurationSerialization) -> Self:
54 from archinstall.lib.profile.profiles_handler import profile_handler
55
56 profile = profile_handler.parse_profile_config(arg['profile'])
57 greeter = arg.get('greeter', None)
58 gfx_driver = arg.get('gfx_driver', None)
59
60 if gfx_driver == 'Nvidia (proprietary)':
61 raise ValueError(
62 'The Nvidia proprietary driver (nvidia-dkms) has been removed from the Arch repos. '
63 'Please use "Nvidia (open kernel module for newer GPUs, Turing+)" instead.'
64 )
65
66 return cls(
67 profile,
68 GfxDriver(gfx_driver) if gfx_driver else None,
69 GreeterType(greeter) if greeter else None,
70 )

Callers 5

test_config_file_parsingFunction · 0.90
__init__Method · 0.90
perform_installationFunction · 0.90
perform_installationFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_config_file_parsingFunction · 0.72