1
2 from ModeSelectorComponent import ModeSelectorComponent
3 from InputControlElement import InputControlElement
4
6 """ Class switches modes by translating the given controls' message channel """
7
12
16
18 raise self._controls_to_translate == None or AssertionError
19 raise controls != None or AssertionError
20 raise isinstance(controls, tuple) or AssertionError
21 for control in controls:
22 raise isinstance(control, InputControlElement) or AssertionError
23
24 self._controls_to_translate = controls
25
27 result = self._initial_num_modes
28 if result == 0 and self._modes_buttons != None:
29 result = len(self._modes_buttons)
30 return result
31
38