Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples/only_hd.py
diff options
context:
space:
mode:
authorWerner Llácer <wllacer@gmail.com>2022-03-28 13:55:15 +0200
committerGitHub <noreply@github.com>2022-03-28 13:55:15 +0200
commit4b4473632df0fbc92e85f6e32f6e940ad4fb6fa7 (patch)
treec7fff6b42db3c2cadb19051b14c566d40c5a93bf /examples/only_hd.py
parent3dc0d957e838c34b48a0782d2540341e33b24070 (diff)
Subvolume User Interface (#1032)
* Deflate the user interactions file * Fix flake8 * GlobalMenu split from selection_menu.py * Upgrades to ListManager: Can now show an empty list if there is no null action. More information to the user at the header * Put only_hd.py and swiss.py to use new config printing mechanism Solved a couple of bugs at ListManager adding a str and a DeferredTranslation ManageUser was missing an self argument in _check ... * Create list and menus to manage subvolumes in btrfs partitions Needed to modify manage_new_and_existing_partitions Added a new parameter filter to select_partition, to allow filtering there * Update internationalization strings Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com> Co-authored-by: Anton Hvornum <anton@hvornum.se>
Diffstat (limited to 'examples/only_hd.py')
-rw-r--r--examples/only_hd.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/examples/only_hd.py b/examples/only_hd.py
index 76a616db..b3379601 100644
--- a/examples/only_hd.py
+++ b/examples/only_hd.py
@@ -14,7 +14,7 @@ class OnlyHDMenu(archinstall.GlobalMenu):
mandatory_list = []
options_list = ['harddrives', 'disk_layouts', '!encryption-password','swap']
mandatory_list = ['harddrives']
- options_list.extend(['install','abort'])
+ options_list.extend(['save_config','install','abort'])
for entry in self._menu_options:
if entry in options_list:
@@ -27,15 +27,27 @@ class OnlyHDMenu(archinstall.GlobalMenu):
self.option(entry).set_enabled(False)
self._update_install_text()
+ def mandatory_lacking(self) -> [int, list]:
+ mandatory_fields = []
+ mandatory_waiting = 0
+ for field in self._menu_options:
+ option = self._menu_options[field]
+ if option.is_mandatory():
+ if not option.has_selection():
+ mandatory_waiting += 1
+ mandatory_fields += [field,]
+ return mandatory_fields, mandatory_waiting
+
def _missing_configs(self):
""" overloaded method """
def check(s):
return self.option(s).has_selection()
- _, missing = self.mandatory_overview()
+ missing, missing_cnt = self.mandatory_lacking()
if check('harddrives'):
if not self.option('harddrives').is_empty() and not check('disk_layouts'):
- missing += 1
+ missing_cnt += 1
+ missing += ['disk_layout']
return missing
def ask_user_questions():