Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/menu
diff options
context:
space:
mode:
authorDaniel Girtler <blackrabbit256@gmail.com>2022-05-05 20:48:01 +1000
committerGitHub <noreply@github.com>2022-05-05 12:48:01 +0200
commitbcd810d2d20e657d96f36e0007facff71e9532bc (patch)
treeb3b50f73b6b159bab19d5caaa279f0e3d637568c /archinstall/lib/menu
parent2d371571783cde70554e3e4e272beab2546ffff9 (diff)
Fix 1117 (#1126)
* Fix 1117 * Update * flake8 Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
Diffstat (limited to 'archinstall/lib/menu')
-rw-r--r--archinstall/lib/menu/global_menu.py4
-rw-r--r--archinstall/lib/menu/menu.py14
2 files changed, 16 insertions, 2 deletions
diff --git a/archinstall/lib/menu/global_menu.py b/archinstall/lib/menu/global_menu.py
index 63b8c03e..b3c5c6a2 100644
--- a/archinstall/lib/menu/global_menu.py
+++ b/archinstall/lib/menu/global_menu.py
@@ -262,9 +262,9 @@ class GlobalMenu(GeneralMenu):
"Do you wish to continue?"
).format(storage['MOUNT_POINT'])
- choice = Menu(prompt, ['yes', 'no'], default_option='yes').run()
+ choice = Menu(prompt, Menu.yes_no(), default_option=Menu.yes()).run()
- if choice == 'no':
+ if choice == Menu.no():
exit(1)
return harddrives
diff --git a/archinstall/lib/menu/menu.py b/archinstall/lib/menu/menu.py
index d254e0f9..48ea4635 100644
--- a/archinstall/lib/menu/menu.py
+++ b/archinstall/lib/menu/menu.py
@@ -12,7 +12,21 @@ import logging
if TYPE_CHECKING:
_: Any
+
class Menu(TerminalMenu):
+
+ @classmethod
+ def yes(cls):
+ return str(_('yes'))
+
+ @classmethod
+ def no(cls):
+ return str(_('no'))
+
+ @classmethod
+ def yes_no(cls):
+ return [cls.yes(), cls.no()]
+
def __init__(
self,
title :str,