fix: use __dict__ instead of dir

This commit is contained in:
Daylin Morgan 2022-09-07 15:44:17 -05:00
parent c036a27a57
commit 41c398065c
3 changed files with 5 additions and 6 deletions

View file

@ -86,8 +86,9 @@ info:
$(call tprint,$(mlmsg)) $(call tprint,$(mlmsg))
$(call tprint,{a.custom(fg=(148, 255, 15),bg=(103, 2, 15))}Custom Colors TOO!{a.end}) $(call tprint,{a.custom(fg=(148, 255, 15),bg=(103, 2, 15))}Custom Colors TOO!{a.end})
.PHONY: task.mk
task.mk: task.mk:
./generate.py $(shell git describe --tags) > task.mk ./generate.py $(shell git describe --always | sed s'/dirty/dev/') > task.mk
define USAGE define USAGE
{a.$(HEADER_COLOR)}usage:{a.end} {a.$(HEADER_COLOR)}usage:{a.end}

View file

@ -5,8 +5,7 @@
codes_names = { codes_names = {
getattr(ansi, attr): attr getattr(ansi, attr): attr
for attr in dir(ansi) for attr in ansi.__dict__
if attr[0:1] != "_" and attr != "end" and attr != "setcode"
} }
for code in sorted(codes_names.keys(), key=lambda item: (len(item), item)): for code in sorted(codes_names.keys(), key=lambda item: (len(item), item)):
print("{:>20} {}".format(codes_names[code], code + "******" + ansi.end)) print("{:>20} {}".format(codes_names[code], code + "******" + ansi.end))

View file

@ -1,7 +1,7 @@
# }> [github.com/daylinmorgan/task.mk] <{ # # }> [github.com/daylinmorgan/task.mk] <{ #
# Copyright (c) 2022 Daylin Morgan # Copyright (c) 2022 Daylin Morgan
# MIT License # MIT License
# version: 22.9.7 # version: c036a27
# #
# task.mk should be included at the bottom of your Makefile. # task.mk should be included at the bottom of your Makefile.
# See below for the standard configuration options that should be set prior to including this file. # See below for the standard configuration options that should be set prior to including this file.
@ -240,8 +240,7 @@ $(ansi_py)
codes_names = { codes_names = {
getattr(ansi, attr): attr getattr(ansi, attr): attr
for attr in dir(ansi) for attr in ansi.__dict__
if attr[0:1] != "_" and attr != "end" and attr != "setcode"
} }
for code in sorted(codes_names.keys(), key=lambda item: (len(item), item)): for code in sorted(codes_names.keys(), key=lambda item: (len(item), item)):
print("{:>20} {}".format(codes_names[code], code + "******" + ansi.end)) print("{:>20} {}".format(codes_names[code], code + "******" + ansi.end))