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 1Pqe6U-0004BU-Ec for garchives@archives.gentoo.org; Sat, 19 Feb 2011 04:07:30 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E66271C001; Sat, 19 Feb 2011 04:07:21 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B65961C001 for ; Sat, 19 Feb 2011 04:07:21 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D455D1B4012 for ; Sat, 19 Feb 2011 04:07:20 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 17D728006A for ; Sat, 19 Feb 2011 04:07:20 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: Subject: [gentoo-commits] proj/layman:master commit in: layman/ X-VCS-Repository: proj/layman X-VCS-Files: layman/config.py X-VCS-Directories: layman/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: f2dd98035ee2c90bb01174d6f816a4866b1c0f7d Date: Sat, 19 Feb 2011 04:07:20 +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: a19e565a28d6d1990567b64162282a44 commit: f2dd98035ee2c90bb01174d6f816a4866b1c0f7d Author: Brian Dolbec gmail com> AuthorDate: Sat Feb 19 04:06:51 2011 +0000 Commit: Brian Dolbec gmail com> CommitDate: Sat Feb 19 04:06:51 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/layman.git;a=3D= commit;h=3Df2dd9803 add nocolr to BareConfig and improve quiet/quietness handling --- layman/config.py | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/layman/config.py b/layman/config.py index a2b9377..6c3677c 100644 --- a/layman/config.py +++ b/layman/config.py @@ -119,7 +119,8 @@ class BareConfig(object): 'stdin': stdin if stdin else sys.stdin, 'stderr': stderr if stderr else sys.stderr, 'output': output if output else OUT, - 'quietness': '4', + 'quietness': 4, + 'nocolor': False, 'width': 0, 'verbose': False, 'quiet': False, @@ -157,7 +158,15 @@ class BareConfig(object): """Sets an option to the value """ self._options[option] =3D value # handle quietness + if option =3D=3D 'quiet': + if self._option['quiet']: + self._set_quietness(1) + else: + self._set_quietness(4) if option =3D=3D 'quietness': + self._set_quietness() + + def _set_quietness(self, value) self._option['output'].set_info_level(int(self['quietness'])= ) self._option['output'].set_warn_level(int(self['quietness'])= ) =20