Ejemplo n.º 1
0
    def write(threads, prefix='', rewind=True, append=None, debug=False, profile=False):
        t_cnt = len(threads)

        for id, thread in threads:
            if thread.is_alive():
                _line = ''.join((t.black('({})'.format(id)), ' ', t.bold(t.white('+')), ' ', thread.name, ' ',
                                 thread.transform.get_unicode_stats(debug=debug, profile=profile), ' ', ))
            else:
                _line = t.black(''.join(
                    ('({})'.format(id), ' - ', thread.name, ' ', thread.transform.get_unicode_stats(debug=debug, profile=profile), ' ', )))
            print prefix + _line + t.clear_eol

        if append:
            # todo handle multiline
            print ' `->', ' '.join(u'{0}: {1}'.format(t.bold(t.white(k)), v) for k, v in append), t.clear_eol
            t_cnt += 1

        if rewind:
            print t.clear_eol
            print t.move_up * (t_cnt + 2)
Ejemplo n.º 2
0
def run(harness):
    print
    retval = harness()
    print " `-> {0}: {1}".format(t.bold(t.white("Return")), retval)
    print
Ejemplo n.º 3
0
def run(harness):
    print
    retval = harness()
    print ' `-> {0}: {1}'.format(t.bold(t.white('Return')), retval)
    print