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 1PqkZk-00073c-22 for garchives@archives.gentoo.org; Sat, 19 Feb 2011 11:02:27 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9C2921C01C; Sat, 19 Feb 2011 11:01:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 6EE6A1C01C for ; Sat, 19 Feb 2011 11:01:46 +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 DA5181B4324 for ; Sat, 19 Feb 2011 11:01:45 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 3CD4280075 for ; Sat, 19 Feb 2011 11:01:45 +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: <990e967e10ec6511aa8e58beacdc9c3a5a029fcc.dol-sen@gentoo> 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: 990e967e10ec6511aa8e58beacdc9c3a5a029fcc Date: Sat, 19 Feb 2011 11:01:45 +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: 31818ea6b72d217f421a24ef01bd7553 commit: 990e967e10ec6511aa8e58beacdc9c3a5a029fcc Author: Brian Dolbec gmail com> AuthorDate: Sat Feb 19 11:01:30 2011 +0000 Commit: Brian Dolbec gmail com> CommitDate: Sat Feb 19 11:01:30 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/layman.git;a=3D= commit;h=3D990e967e Create a new single import high level Layman class --- layman/__init__.py | 48 ++++++++++++++++++++++++++++++++++++++++++++++= +- 1 files changed, 47 insertions(+), 1 deletions(-) diff --git a/layman/__init__.py b/layman/__init__.py index 792d600..e27488a 100644 --- a/layman/__init__.py +++ b/layman/__init__.py @@ -1 +1,47 @@ -# +#!/usr/bin/python +# -*- coding: utf-8 -*- + +"""Layman is a complete library for the operation and maintainance +on all gentoo repositories and overlays +""" + + + +class Layman(object): + """High level interface capable of performing all + overlay repository actions.""" + + def __init__(self, stdout=3DNone, stdin=3DNone, stderr=3DNone, + config=3DNone, read_configfile=3DTrue, quiet=3DFalse, quietness=3D= 4, + verbose=3DFalse, nocolor=3DFalse, width=3D0 + ): + """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.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 + ) + self.layman =3D LaymanAPI(self.config, + report_errors=3DTrue, + output=3Dconfig['output'] + ) + return _layman