index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | archinstall/lib/user_interaction/subvolume_config.py | 33 |
diff --git a/archinstall/lib/user_interaction/subvolume_config.py b/archinstall/lib/user_interaction/subvolume_config.py index 6de8d0ef..0515876b 100644 --- a/archinstall/lib/user_interaction/subvolume_config.py +++ b/archinstall/lib/user_interaction/subvolume_config.py @@ -1,3 +1,5 @@ +from typing import List, Any, Dict + from ..menu.list_manager import ListManager from ..menu.selection_menu import Selector, GeneralMenu from ..menu.text_input import TextInput @@ -12,8 +14,8 @@ class SubvolumeList(ListManager): self.ObjectDefaultAction = str(_('Add')) super().__init__(prompt,list,None,self.ObjectNullAction,self.ObjectDefaultAction) - def reformat(self): - def presentation(key,value): + def reformat(self, data: Any) -> List[Any]: + def presentation(key :str, value :Dict): text = _(" Subvolume :{:16}").format(key) if isinstance(value,str): text += _(" mounted at {:16}").format(value) @@ -26,32 +28,31 @@ class SubvolumeList(ListManager): text += _(" with option {}").format(', '.join(value['options'])) return text - return sorted(list(map(lambda x:presentation(x,self.data[x]),self.data))) + return sorted(list(map(lambda x:presentation(x,data[x]),data))) def action_list(self): return super().action_list() - def exec_action(self): + def exec_action(self, data: Any): if self.target: origkey,origval = list(self.target.items())[0] else: origkey = None if self.action == str(_('Delete')): - del self.data[origkey] - return True - - if self.action == str(_('Add')): - self.target = {} - print(_('\n Fill the desired values for a new subvolume \n')) - with SubvolumeMenu(self.target,self.action) as add_menu: - for data in ['name','mountpoint','options']: - add_menu.exec_option(data) + del data[origkey] else: - SubvolumeMenu(self.target,self.action).run() - self.data.update(self.target) + if self.action == str(_('Add')): + self.target = {} + print(_('\n Fill the desired values for a new subvolume \n')) + with SubvolumeMenu(self.target,self.action) as add_menu: + for data in ['name','mountpoint','options']: + add_menu.exec_option(data) + else: + SubvolumeMenu(self.target,self.action).run() + + data.update(self.target) - return True class SubvolumeMenu(GeneralMenu): def __init__(self,parameters,action=None): |