MCPcopy Create free account
hub / github.com/corpnewt/GenSMBIOS / cprint

Method cprint

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

Source from the content-addressed store, hash-verified

173 os.system('cls' if os.name=='nt' else 'clear')
174
175 def cprint(self, message, **kwargs):
176 strip_colors = kwargs.get("strip_colors", False)
177 if os.name == "nt":
178 strip_colors = True
179 reset = u"\u001b[0m"
180 # Requires sys import
181 for c in self.colors:
182 if strip_colors:
183 message = message.replace(c["find"], "")
184 else:
185 message = message.replace(c["find"], c["replace"])
186 if strip_colors:
187 return message
188 sys.stdout.write(message)
189 print(reset)
190
191 # Needs work to resize the string if color chars exist
192 '''# Header drawing method

Callers

nothing calls this directly

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected