MCPcopy Create free account
hub / github.com/apache/trafficserver / fancy_chain_print

Function fancy_chain_print

tools/records/convert2yaml.py:70–91  ·  view source on GitHub ↗
(lst, isError=False)

Source from the content-addressed store, hash-verified

68
69
70def fancy_chain_print(lst, isError=False):
71 output = StringIO()
72 if len(lst) == 1:
73 output.write(f'» {lst[0]}\n')
74 s = output.getvalue()
75 output.close()
76 return s
77 space = ''
78 output.write(f'┌■ {lst[0]}\n')
79 if len(lst) > 2:
80 space = ' '
81 # from 2nd till end-1
82 output.write(f'└┬──» {lst[1]}\n')
83 for x in lst[2:-1]:
84 output.write(f' ├──» {x}\n')
85
86 z = lst[-1]
87 output.write(f'{space}└──» {z}\n')
88
89 s = output.getvalue()
90 output.close()
91 return s
92
93
94def progressbar(it, size=60, out=sys.stdout, mute=False):

Callers 1

print_summaryFunction · 0.85

Calls 2

writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected