MCPcopy
hub / github.com/corpnewt/gibMacOS / cprint

Method cprint

Scripts/utils.py:188–202  ·  view source on GitHub ↗
(self, message, **kwargs)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected