11from __future__ import annotations
22
3- from typing import Any , Self
3+ from typing import Any
44
55from archinstall .lib .translationhandler import tr
6- from archinstall .tui .curses_menu import SelectMenu , Tui
6+ from archinstall .tui .curses_menu import SelectMenu
77from archinstall .tui .menu_item import MenuItem , MenuItemGroup
88from archinstall .tui .result import ResultType
99from archinstall .tui .types import Chars , FrameProperties , FrameStyle , PreviewStyle
1010
11- from ..output import error
12-
1311CONFIG_KEY = '__config__'
1412
1513
@@ -28,24 +26,8 @@ def __init__(
2826 self ._allow_reset = allow_reset
2927 self ._reset_warning = reset_warning
3028
31- self .is_context_mgr = False
32-
3329 self ._sync_from_config ()
3430
35- def __enter__ (self , * args : Any , ** kwargs : Any ) -> Self :
36- self .is_context_mgr = True
37- return self
38-
39- def __exit__ (self , * args : Any , ** kwargs : Any ) -> None :
40- # TODO: https://stackoverflow.com/questions/28157929/how-to-safely-handle-an-exception-inside-a-context-manager
41- # TODO: skip processing when it comes from a planified exit
42- if len (args ) >= 2 and args [1 ]:
43- error (args [1 ])
44- Tui .print ('Please submit this issue (and file) to https://github.com/archlinux/archinstall/issues' )
45- raise args [1 ]
46-
47- self .sync_all_to_config ()
48-
4931 def _sync_from_config (self ) -> None :
5032 for item in self ._menu_item_group ._menu_items :
5133 if item .key is not None and not item .key .startswith (CONFIG_KEY ):
0 commit comments