From 7a970a992bfc1fea6c37ef96378c2fd4bfbc8b17 Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Sat, 19 Feb 2011 02:43:11 -0800 Subject: eliminate the need to import Message, cleanup some stale comments. --- layman/api.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/layman/api.py b/layman/api.py index 63682f6..8081bcb 100644 --- a/layman/api.py +++ b/layman/api.py @@ -21,8 +21,6 @@ from layman.config import BareConfig from layman.dbbase import UnknownOverlayException, UnknownOverlayMessage from layman.db import DB, RemoteDB #from layman.utils import path, delete_empty_directory -#from layman.debug import OUT -from layman.output import OUT # give them some values for now, these are from the packagekit backend # TODO establish some proper errors for the api. @@ -31,11 +29,6 @@ ERROR_INTERNAL_ERROR = -2 UNKNOWN_REPO_ID = "Repo ID '%s' " + \ "is not listed in the current available overlays list" -# In order to redirect output you need to get a Message class instance with the -# stderr, stdout, stddebug directed to where you want. -# eg: output = Message('layman', err=mystderr, dbg=mydebug, out=myoutput) -# there are many more options available, refer to debug.py Message class - class LaymanAPI(object): """class to hold and run a layman instance for use by API consumer apps, guis, etc. @@ -54,10 +47,10 @@ class LaymanAPI(object): default is Message(module='layman') other params are defaults. """ - self.output = output if output else OUT - self.config = config if config else BareConfig(output=output) + self.output = self.config['output'] + self.report_errors = report_errors # get installed and available dbs -- cgit v1.2.3-1-g7c22