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 1Pomhp-0006HV-Tw for garchives@archives.gentoo.org; Mon, 14 Feb 2011 00:54:27 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 17AB7E09AD; Mon, 14 Feb 2011 00:54:14 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id C9546E09AD for ; Mon, 14 Feb 2011 00:54:13 +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 DB1421B4094 for ; Mon, 14 Feb 2011 00:54:12 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 4E3028006A for ; Mon, 14 Feb 2011 00:54:12 +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: <306b419af140c6e1eb41a2114005b20b82a5332c.dol-sen@gentoo> Subject: [gentoo-commits] proj/layman:overlord_merge commit in: layman/ X-VCS-Repository: proj/layman X-VCS-Files: layman/constants.py layman/output.py X-VCS-Directories: layman/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 306b419af140c6e1eb41a2114005b20b82a5332c Date: Mon, 14 Feb 2011 00:54:12 +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: 4e3a97b3f302970ca40117bb9d6f9a31 Message-ID: <20110214005412.Dli7Ia2PE_kdu2AHfnn2dv_74ZfUzoiW7EOyD6rfMUk@z> commit: 306b419af140c6e1eb41a2114005b20b82a5332c Author: Brian Dolbec gmail com> AuthorDate: Sun Feb 13 09:30:24 2011 +0000 Commit: Brian Dolbec gmail com> CommitDate: Sun Feb 13 09:30:24 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/layman.git;a=3D= commit;h=3D306b419a further simplify, reduce the number of functions --- layman/constants.py | 7 +++++++ layman/output.py | 37 +++++++++---------------------------- 2 files changed, 16 insertions(+), 28 deletions(-) diff --git a/layman/constants.py b/layman/constants.py index 7fc72ea..6962867 100644 --- a/layman/constants.py +++ b/layman/constants.py @@ -43,3 +43,10 @@ codes['turquoise'] =3D esc_seq + '36;01m' NOT_OFFICIAL_MSG =3D '*** This is not an official gentoo overlay ***\n' NOT_SUPPORTED_MSG =3D '*** You are lacking the necessary tools' +\ ' to install this overlay ***\n' + + +OFF =3D 0 +WARN_LEVEL =3D 4 +INFO_LEVEL =3D 4 +DEBUG_LEVEL =3D 4 +DEBUG_VERBOSITY =3D 2 diff --git a/layman/output.py b/layman/output.py index 49ebb34..5785d58 100644 --- a/layman/output.py +++ b/layman/output.py @@ -14,7 +14,7 @@ import sys, inspect, types =20 from optparse import OptionGroup =20 -from overlord.constants import codes +from layman.constants import codes, INFO_LEVEL, WARN_LEVEL, OFF =20 =20 =20 @@ -25,8 +25,8 @@ class Message: def __init__(self, out =3D sys.stdout, err =3D sys.stderr, - info_level =3D 4, - warn_level =3D 4, + info_level =3D INFO_LEVEL, + warn_level =3D WARN_LEVEL, col =3D True ): =20 @@ -63,43 +63,26 @@ class Message: self.color_func =3D self.no_color =20 =20 - def set_info_level(self, info_level =3D 4): + def set_info_level(self, info_level =3D INFO_LEVEL): self.info_lev =3D info_level =20 =20 - def info_off(self): - self.set_info_level(0) - - - def info_on(self, info_level =3D 4): - self.set_info_level(info_level) - - - def set_warn_level(self, warn_level =3D 4): + def set_warn_level(self, warn_level =3D WARN_LEVEL): self.warn_lev =3D warn_level =20 =20 - def warn_off(self): - self.set_warn_level(0) - - - def warn_on(self, warn_level =3D 4): - self.set_warn_level(warn_level) - - - - ## Output Functions =20 - def debug(self, info, level=3D0): + def debug(self, info, level =3D OFF): """empty debug function""" pass =20 + def notice (self, note): print >> self.std_out, note =20 =20 - def info (self, info, level =3D 4): + def info (self, info, level =3D INFO_LEVEL): =20 #print "info =3D", info =20 @@ -142,9 +125,7 @@ class Message: '.' * (58 - len(i)) + ' ' + result =20 =20 - def warn (self, warn, level =3D 4): - - #print "DEBUG.warn()" + def warn (self, warn, level =3D WARN_LEVEL): =20 if type(warn) not in types.StringTypes: warn =3D str(warn)