MCPcopy Index your code
hub / github.com/archlinux/archinstall / from_arg

Method from_arg

archinstall/lib/models/bootloader.py:49–60  ·  view source on GitHub ↗
(cls, bootloader: str, skip_boot: bool)

Source from the content-addressed store, hash-verified

47
48 @classmethod
49 def from_arg(cls, bootloader: str, skip_boot: bool) -> Self:
50 # to support old configuration files
51 bootloader = bootloader.capitalize()
52
53 bootloader_options = [e.value for e in cls if e != cls.NO_BOOTLOADER or skip_boot is True]
54
55 if bootloader not in bootloader_options:
56 values = ', '.join(bootloader_options)
57 warn(f'Invalid bootloader value "{bootloader}". Allowed values: {values}')
58 sys.exit(1)
59
60 return cls(bootloader)
61
62
63class PlymouthTheme(Enum):

Callers 2

from_configMethod · 0.45
parse_argMethod · 0.45

Calls 2

warnFunction · 0.90
exitMethod · 0.80

Tested by

no test coverage detected