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

Class Input

archinstall/lib/menu/helpers.py:135–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133
134
135class Input:
136 def __init__(
137 self,
138 header: str | None = None,
139 placeholder: str | None = None,
140 password: bool = False,
141 default_value: str | None = None,
142 allow_skip: bool = True,
143 allow_reset: bool = False,
144 validator_callback: Callable[[str], str | None] | None = None,
145 info_callback: Callable[[str], InputInfo | None] | None = None,
146 ):
147 self._header = header
148 self._placeholder = placeholder
149 self._password = password
150 self._default_value = default_value
151 self._allow_skip = allow_skip
152 self._allow_reset = allow_reset
153 self._validator_callback = validator_callback
154 self._info_callback = info_callback
155
156 async def show(self) -> Result[str]:
157 validator = GenericValidator(self._validator_callback) if self._validator_callback else None
158
159 result = await InputScreen(
160 header=self._header,
161 placeholder=self._placeholder,
162 password=self._password,
163 default_value=self._default_value,
164 allow_skip=self._allow_skip,
165 allow_reset=self._allow_reset,
166 validator=validator,
167 info_callback=self._info_callback,
168 ).run()
169
170 if result.type_ == ResultType.Reset:
171 confirmed = await _confirm_reset()
172
173 if confirmed.get_value() is False:
174 return await self.show()
175
176 return result
177
178
179class Loading[ValueT]:

Callers 14

_add_userMethod · 0.90
_get_ip_addressMethod · 0.90
get_passwordFunction · 0.90
prompt_dirFunction · 0.90
select_hostnameFunction · 0.90
_prompt_sizeMethod · 0.90
_add_subvolumeMethod · 0.90
select_iteration_timeFunction · 0.90
_add_custom_serverMethod · 0.90
composeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected