task.mk/src/print-colors.py

15 lines
427 B
Python
Raw Normal View History

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