From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RAE8k-0003k7-JE for garchives@archives.gentoo.org; Sun, 02 Oct 2011 04:59:02 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 378BB21C0C1; Sun, 2 Oct 2011 04:58:55 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0589A21C0C1 for ; Sun, 2 Oct 2011 04:58:54 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8CA3A1B4005 for ; Sun, 2 Oct 2011 04:58:54 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id AC3D780042 for ; Sun, 2 Oct 2011 04:58:53 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/output.py X-VCS-Directories: pym/portage/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: c246c6db51b97f1c556c8bddfb955e7f55db700f Date: Sun, 2 Oct 2011 04:58:53 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 2cb67f4530bb0f712383f7101755d765 commit: c246c6db51b97f1c556c8bddfb955e7f55db700f Author: Zac Medico gentoo org> AuthorDate: Sun Oct 2 04:58:35 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Oct 2 04:58:35 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Dc246c6db Convert create_color_func into a class. --- pym/portage/output.py | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pym/portage/output.py b/pym/portage/output.py index 763d74a..6b10f7b 100644 --- a/pym/portage/output.py +++ b/pym/portage/output.py @@ -341,12 +341,12 @@ compat_functions_colors =3D ["bold","white","teal",= "turquoise","darkteal", "fuchsia","purple","blue","darkblue","green","darkgreen","yellow", "brown","darkyellow","red","darkred"] =20 -def create_color_func(color_key): - def derived_func(*args): - newargs =3D list(args) - newargs.insert(0, color_key) - return colorize(*newargs) - return derived_func +class create_color_func(object): + __slots__ =3D ("_color_key",) + def __init__(self, color_key): + self._color_key =3D color_key + def __call__(self, text): + return colorize(self._color_key, text) =20 for c in compat_functions_colors: globals()[c] =3D create_color_func(c)