summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/output.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/pym/portage/output.py b/pym/portage/output.py
index 763d74a7a..6b10f7b6c 100644
--- a/pym/portage/output.py
+++ b/pym/portage/output.py
@@ -341,12 +341,12 @@ compat_functions_colors = ["bold","white","teal","turquoise","darkteal",
"fuchsia","purple","blue","darkblue","green","darkgreen","yellow",
"brown","darkyellow","red","darkred"]
-def create_color_func(color_key):
- def derived_func(*args):
- newargs = list(args)
- newargs.insert(0, color_key)
- return colorize(*newargs)
- return derived_func
+class create_color_func(object):
+ __slots__ = ("_color_key",)
+ def __init__(self, color_key):
+ self._color_key = color_key
+ def __call__(self, text):
+ return colorize(self._color_key, text)
for c in compat_functions_colors:
globals()[c] = create_color_func(c)