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

Method parse_arg

archinstall/lib/models/network.py:127–147  ·  view source on GitHub ↗
(cls, config: _NetworkConfigurationSerialization)

Source from the content-addressed store, hash-verified

125
126 @classmethod
127 def parse_arg(cls, config: _NetworkConfigurationSerialization) -> Self | None:
128 nic_type = config.get('type', None)
129 if not nic_type:
130 return None
131
132 match NicType(nic_type):
133 case NicType.ISO:
134 return cls(NicType.ISO)
135 case NicType.NM:
136 return cls(NicType.NM)
137 case NicType.NM_IWD:
138 return cls(NicType.NM_IWD)
139 case NicType.IWD:
140 return cls(NicType.IWD)
141 case NicType.MANUAL:
142 nics_arg = config.get('nics', [])
143 if nics_arg:
144 nics = [Nic.parse_arg(n) for n in nics_arg]
145 return cls(NicType.MANUAL, nics)
146
147 return None
148
149
150@dataclass

Callers

nothing calls this directly

Calls 2

NicTypeClass · 0.85
parse_argMethod · 0.45

Tested by

no test coverage detected