11import curses
2- from typing import Callable , Union
2+ from typing import Callable , Union , List
33from .base import BaseMenu
44from .misc import Option , Keyboard , FunctionalOption
55
@@ -35,7 +35,7 @@ class MultiSelectorMenu(BaseMenu):
3535 :param count: a number of max chosen options
3636 """
3737
38- def __init__ (self , options : list [str ], title : str = '' , default_index : int = 0 , indicator : str = "->" ,
38+ def __init__ (self , options : List [str ], title : str = '' , default_index : int = 0 , indicator : str = "->" ,
3939 count : int = None ) -> None :
4040
4141 count = len (options ) if not count else count
@@ -44,7 +44,7 @@ def __init__(self, options: list[str], title: str = '', default_index: int = 0,
4444
4545 super ().__init__ (options , title , default_index , indicator )
4646 self .__count = count
47- self .__selected : list [int ] = []
47+ self .__selected : List [int ] = []
4848 self ._control_config [Keyboard .SELECT ] = self .__select
4949
5050 # region Private
@@ -71,7 +71,7 @@ def _draw_options(self, screen, max_x: int) -> None:
7171 screen .addnstr (self ._y , 0 , line , max_x )
7272 self ._y += 1
7373
74- def _get_selected (self ) -> Union [list [Option ], None ]:
74+ def _get_selected (self ) -> Union [List [Option ], None ]:
7575 if not self .__selected :
7676 return
7777 return [Option (index = i , name = self ._options [i ]) for i in sorted (self .__selected )]
@@ -95,11 +95,11 @@ class FunctionalMenu(BaseMenu):
9595 :param indicator: (optional) customize the selection indicator
9696 """
9797
98- def __init__ (self , options : list [FunctionalOption ], title : str = '' , default_index : int = 0 ,
98+ def __init__ (self , options : List [FunctionalOption ], title : str = '' , default_index : int = 0 ,
9999 indicator : str = "->" ) -> None :
100100
101- self .__functions : list [Callable ] = []
102- local_options : list [str ] = []
101+ self .__functions : List [Callable ] = []
102+ local_options : List [str ] = []
103103 for option in options :
104104 self .__functions .append (option .func )
105105 local_options .append (option .name )
0 commit comments