Beispiel #1
0
Datei: show.py Projekt: rjc/dbts
 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
Beispiel #2
0
 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
Beispiel #3
0
 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')
Beispiel #4
0
 def t(s, x):
     r = M.format('{s}', s=s)
     assert_equal(r, '\x1B[7m' + x + '\x1B[27m')
Beispiel #5
0
 def t(s):
     r = M.format('{s}', s=s)
     assert_equal(r, s)