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 1Qv2qp-00038h-Dk for garchives@archives.gentoo.org; Sun, 21 Aug 2011 07:53:47 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0D08321C0A2; Sun, 21 Aug 2011 07:53:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id BA3FB21C04E for ; Sun, 21 Aug 2011 07:53:39 +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 1B6051B403F for ; Sun, 21 Aug 2011 07:53:39 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 70BA080043 for ; Sun, 21 Aug 2011 07:53:38 +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/__init__.py X-VCS-Directories: layman/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: b2b7b5899a6f61a6545a5b91c5fe8691f4d29cbe Date: Sun, 21 Aug 2011 07:53:38 +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: f7dca41b05ce07e4fce5f86d2ac9de2e commit: b2b7b5899a6f61a6545a5b91c5fe8691f4d29cbe Author: dol-sen gmail com> AuthorDate: Sun Aug 21 07:32:42 2011 +0000 Commit: Brian Dolbec gmail com> CommitDate: Sun Aug 21 07:50:13 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/layman.git;a=3D= commit;h=3Db2b7b589 continue establishing a proper high level interface. --- layman/__init__.py | 50 +++++++++++++++++++++++++---------------------= ---- 1 files changed, 25 insertions(+), 25 deletions(-) diff --git a/layman/__init__.py b/layman/__init__.py index e27488a..9eeff49 100644 --- a/layman/__init__.py +++ b/layman/__init__.py @@ -5,10 +5,18 @@ on all gentoo repositories and overlays """ =20 +try: + from layman.api import LaymanAPI + from layman.config import BareConfig + from layman.output import Message +except ImportError: + import sys + sys.stderr.write("!!! Layman API import failed.") =20 =20 -class Layman(object): - """High level interface capable of performing all + +class Layman(LaymanAPI): + """A complete high level interface capable of performing all overlay repository actions.""" =20 def __init__(self, stdout=3DNone, stdin=3DNone, stderr=3DNone, @@ -18,30 +26,22 @@ class Layman(object): """Input parameters are optional to override the defaults. sets up our LaymanAPI with defaults or passed in values and returns an instance of it""" - import sys - try: - from layman.api import LaymanAPI - from layman.config import BareConfig - from layman.output import Message - except ImportError: - sys.stderr.write("!!! Layman API import failed.") - return None - self.message =3D Message() + self.message =3D Message(out=3Dstdout, err=3Dstderr) self.config =3D BareConfig( - output=3Dmessage, - stdout=3DNone, - stdin=3DNone, - stderr=3DNone, - config=3DNone, - read_configfile=3DTrue, - quiet=3DFalse, - quietness=3D4, - verbose=3DFalse, - nocolor=3DFalse, - width=3D0 + output=3Dself.message, + stdout=3Dstdout, + stdin=3Dstdin, + stderr=3Dstderr, + config=3Dconfig, + read_configfile=3Dread_configfile, + quiet=3Dquiet, + quietness=3Dquietness, + verbose=3Dverbose, + nocolor=3Dnocolor, + width=3Dwidth ) - self.layman =3D LaymanAPI(self.config, + LaymanAPI.__init__(self, self.config, report_errors=3DTrue, - output=3Dconfig['output'] + output=3Dself.config['output'] ) - return _layman + return