task.mk/src/print-ansi.py

15 lines
418 B
Python
Raw Normal View History

2022-09-05 12:23:17 -05:00
#% extends "py-script.mk" %#
2022-09-05 17:44:39 -05:00
#% block name %#print_ansi#% endblock %#
2022-09-05 12:23:17 -05:00
#% block script %#
2022-09-05 17:44:39 -05:00
##- '$(ansi_py)' -##
2022-09-05 12:23:17 -05:00
codes_names = {
2022-09-05 17:44:39 -05:00
getattr(ansi, attr): attr
for attr in dir(ansi)
if attr[0:1] != "_" and attr != "end" and attr != "setcode"
2022-09-05 12:23:17 -05:00
}
for code in sorted(codes_names.keys(), key=lambda item: (len(item), item)):
2022-09-05 17:44:39 -05:00
print("{:>20} {}".format(codes_names[code], code + "******" + ansi.end))
2022-09-05 12:23:17 -05:00
#% endblock %#