def decorate(self, text, color=None, on_color=None, attrs=None): if self.colored_output: return termcolor.colored(text, color, on_color, attrs) else: return text