(self, text = None, width = 68, resize=True)
| 186 | print("") |
| 187 | |
| 188 | def head(self, text = None, width = 68, resize=True): |
| 189 | if resize: |
| 190 | self.adjust_window_size() |
| 191 | os.system('cls' if os.name=='nt' else 'clear') |
| 192 | if text == None: |
| 193 | text = self.script_name |
| 194 | separator = "═" * (width - 2) |
| 195 | title = " {} ".format(text) |
| 196 | if len(title) > width - 2: |
| 197 | title = title[:width-4] + "..." |
| 198 | title = title.center(width - 2) |
| 199 | |
| 200 | print("╔{}╗\n║{}║\n╚{}╝".format(separator, title, separator)) |
| 201 | |
| 202 | def adjust_window_size(self, content=""): |
| 203 | lines = content.splitlines() |
no test coverage detected