def notify(self, text, colours = True, disconnect = False): text = '%s' % text if self.transport: self.transport.protocol.sendLine( util.format_colour(text) if colours else text, disconnect = disconnect ) return True else: return False
def test_format_colour(): logger.info(util.format_colour('{bold_on}This text should be {fg_blue}blue{fg_default}{bold_off}.{reset}'))