Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/user_interaction/save_conf.py
diff options
context:
space:
mode:
authorDaniel Girtler <blackrabbit256@gmail.com>2022-05-09 20:02:48 +1000
committerGitHub <noreply@github.com>2022-05-09 12:02:48 +0200
commit0fa52a5424e28ed62ef84bdc92868bbfc434e015 (patch)
tree4b88e7799319aa9489f7e16beedf5517b6feba34 /archinstall/lib/user_interaction/save_conf.py
parent20ffebac50478554a7582de5e5c1d8b4504ea8be (diff)
Introduce ctrl+c and other bug fixes (#1152)
* Intergrate ctrl+c * stash * Update * Fix profile reset * flake8 Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
Diffstat (limited to 'archinstall/lib/user_interaction/save_conf.py')
-rw-r--r--archinstall/lib/user_interaction/save_conf.py27
1 files changed, 15 insertions, 12 deletions
diff --git a/archinstall/lib/user_interaction/save_conf.py b/archinstall/lib/user_interaction/save_conf.py
index c52b97e2..f542bc9b 100644
--- a/archinstall/lib/user_interaction/save_conf.py
+++ b/archinstall/lib/user_interaction/save_conf.py
@@ -5,6 +5,7 @@ from typing import Any, Dict, TYPE_CHECKING
from ..configuration import ConfigurationOutput
from ..menu import Menu
+from ..menu.menu import MenuSelectionType
from ..output import log
if TYPE_CHECKING:
@@ -45,14 +46,16 @@ def save_config(config: Dict):
'all': str(_('Save all'))
}
- selection = Menu(_('Choose which configuration to save'),
- list(options.values()),
- sort=False,
- skip=True,
- preview_size=0.75,
- preview_command=preview).run()
+ choice = Menu(
+ _('Choose which configuration to save'),
+ list(options.values()),
+ sort=False,
+ skip=True,
+ preview_size=0.75,
+ preview_command=preview
+ ).run()
- if not selection:
+ if choice.type_ == MenuSelectionType.Esc:
return
while True:
@@ -62,13 +65,13 @@ def save_config(config: Dict):
break
log(_('Not a valid directory: {}').format(dest_path), fg='red')
- if options['user_config'] == selection:
+ if options['user_config'] == choice.value:
config_output.save_user_config(dest_path)
- elif options['user_creds'] == selection:
+ elif options['user_creds'] == choice.value:
config_output.save_user_creds(dest_path)
- elif options['disk_layout'] == selection:
+ elif options['disk_layout'] == choice.value:
config_output.save_disk_layout(dest_path)
- elif options['all'] == selection:
+ elif options['all'] == choice.value:
config_output.save_user_config(dest_path)
config_output.save_user_creds(dest_path)
- config_output.save_disk_layout
+ config_output.save_disk_layout(dest_path)