Browse Source

Make CliMenuHeader and CliMenuOption private

These classes don't need to be used by the user, only via the API, so we
can mark them private.
Sebastian Lohff 1 year ago
parent
commit
68e6ecbe4f
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      clintermission/climenu.py

+ 5
- 5
clintermission/climenu.py View File

@@ -12,7 +12,7 @@ from prompt_toolkit import search
12 12
 from prompt_toolkit.widgets import SearchToolbar
13 13
 
14 14
 
15
-class CliMenuHeader:
15
+class _CliMenuHeader:
16 16
     """Hold a menu header"""
17 17
     def __init__(self, text, indent=False):
18 18
         self.text = text
@@ -20,7 +20,7 @@ class CliMenuHeader:
20 20
         self.focusable = False
21 21
 
22 22
 
23
-class CliMenuOption:
23
+class _CliMenuOption:
24 24
     """Hold a menu option"""
25 25
     def __init__(self, text, num, item=None):
26 26
         self.text = text
@@ -117,10 +117,10 @@ class CliMenu:
117 117
 
118 118
     def add_text(self, title, indent=True):
119 119
         for text in title.split('\n'):
120
-            self._items.append(CliMenuHeader(text, indent=indent))
120
+            self._items.append(_CliMenuHeader(text, indent=indent))
121 121
 
122 122
     def add_option(self, text, item=None):
123
-        self._items.append(CliMenuOption(text, self._item_num, item=item))
123
+        self._items.append(_CliMenuOption(text, self._item_num, item=item))
124 124
         self._item_num += 1
125 125
 
126 126
     @property
@@ -131,7 +131,7 @@ class CliMenu:
131 131
         return self._success
132 132
 
133 133
     def get_options(self):
134
-        return [_item for _item in self._items if isinstance(_item, CliMenuOption)]
134
+        return [_item for _item in self._items if isinstance(_item, _CliMenuOption)]
135 135
 
136 136
     @property
137 137
     def num_options(self):

Loading…
Cancel
Save