Exemplo n.º 1
0
 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')
Exemplo n.º 2
0
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))