| 186 | os.system("clear") |
| 187 | |
| 188 | def cprint(self, message, **kwargs): |
| 189 | strip_colors = kwargs.get("strip_colors", False) |
| 190 | if os.name == "nt" or not self.interactive: |
| 191 | strip_colors = True |
| 192 | reset = u"\u001b[0m" |
| 193 | # Requires sys import |
| 194 | for c in self.colors: |
| 195 | if strip_colors: |
| 196 | message = message.replace(c["find"], "") |
| 197 | else: |
| 198 | message = message.replace(c["find"], c["replace"]) |
| 199 | if strip_colors: |
| 200 | return message |
| 201 | sys.stdout.write(message) |
| 202 | print(reset) |
| 203 | |
| 204 | # Needs work to resize the string if color chars exist |
| 205 | '''# Header drawing method |