def render(node): label = str(node) if label == 'some versions': label = '...' color = vcolors.get(node.get('fillcolor')) fmt1 = fmt2 = '{line}' if color is not None: fmt1 = color + fmt1 + '{t.off}' label = '\n'.join( colorterm.format(fmt1 if i == 0 else fmt2, line=line) for i, line in enumerate(label.splitlines())) return label
def render(node): label = str(node) if label == 'some versions': label = '...' color = vcolors.get(node.get('fillcolor')) fmt1 = fmt2 = '{line}' if color is not None: fmt1 = color + fmt1 + '{t.off}' label = '\n'.join( colorterm.format(fmt1 if i == 0 else fmt2, line=line) for i, line in enumerate(label.splitlines()) ) return label
def t(s, x=None): r = M.format('{s}', s=s) if x is None: assert_equal(r, s) else: assert_equal(r, '\x1B[7m' + x + '\x1B[27m')
def t(s, x): r = M.format('{s}', s=s) assert_equal(r, '\x1B[7m' + x + '\x1B[27m')
def t(s): r = M.format('{s}', s=s) assert_equal(r, s)