def _print(s): # StringIO will accept unicode (cStringIO does not) sys.stdout = mystdout = StringIO() uprint(s) sys.stdout = old_stdout output = mystdout.getvalue() return output.strip('\n')
def msg(label, txt, first=False, linebreak=False, divider=DIVIDER): """ Print out debug message. """ from garage.text_utils import uprint if first: uprint('\n%s' % divider) if not linebreak: uprint('# %-16s : %s' % (label, txt)) else: uprint('# %-16s :\n%s' % (label, txt))