Browse Source

Rename add_header() to add_text()

add_header() does not necessarily add a header, it might be just text.
Sebastian Lohff 1 year ago
parent
commit
45d3395642
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      clintermission/climenu.py

+ 5
- 2
clintermission/climenu.py View File

@@ -95,7 +95,7 @@ class CliMenu:
95 95
             self._style = self.default_style
96 96
 
97 97
         if header:
98
-            self.add_header(header, indent=False)
98
+            self.add_text(header, indent=False)
99 99
 
100 100
         if options:
101 101
             for option in options:
@@ -104,7 +104,10 @@ class CliMenu:
104 104
                 else:
105 105
                     self.add_option(option, option)
106 106
 
107
-    def add_header(self, title, indent=True):
107
+    def add_header(self, *args, **kwargs):
108
+        return self.add_text(*args, **kwargs)
109
+
110
+    def add_text(self, title, indent=True):
108 111
         for text in title.split('\n'):
109 112
             self._items.append(CliMenuHeader(text, indent=indent))
110 113
 

Loading…
Cancel
Save