summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Dolbec <brian.dolbec@gmail.com>2010-07-11 01:54:22 -0700
committerBrian Dolbec <brian.dolbec@gmail.com>2011-02-11 02:49:14 -0800
commite4b3560bf8b8dbce3c992086a5697fea7aefa200 (patch)
tree2acc31903f5f613ae5dc179369f71fea873fab80
parentbb446c2f548b08ad745ff8b608383314e76a9224 (diff)
downloadlayman-e4b3560bf8b8dbce3c992086a5697fea7aefa200.tar.gz
layman-e4b3560bf8b8dbce3c992086a5697fea7aefa200.tar.bz2
layman-e4b3560bf8b8dbce3c992086a5697fea7aefa200.zip
Remove the Output class as it is not needed, was used for initial testing only.
-rw-r--r--layman/api.py63
1 files changed, 0 insertions, 63 deletions
diff --git a/layman/api.py b/layman/api.py
index e17d70e..902a951 100644
--- a/layman/api.py
+++ b/layman/api.py
@@ -325,69 +325,6 @@ class LaymanAPI(object):
self._error_messages = []
-class Output(Message):
- """a subclass of debug.py's Message to overide several output functions
- for data capture. May not be in final api"""
-
- def __init__(self, error=stderr):
- self.stderr = error
- self.captured = []
- Message.__init__(self, err=error)
-
- def notice (self, note):
- self.captured.append(note)
-
- def info (self, info, level = 4):
-
- if type(info) not in types.StringTypes:
- info = str(info)
-
- if level > self.info_lev:
- return
-
- for i in info.split('\n'):
- self.captured.append(self.maybe_color('green', '* ') + i)
-
- def status (self, message, status, info = 'ignored'):
-
- if type(message) not in types.StringTypes:
- message = str(message)
-
- lines = message.split('\n')
-
- if not lines:
- return
-
- for i in lines[0:-1]:
- self.captured.append(self.maybe_color('green', '* ') + i)
-
- i = lines[-1]
-
- if len(i) > 58:
- i = i[0:57]
-
- if status == 1:
- result = '[' + self.maybe_color('green', 'ok') + ']'
- elif status == 0:
- result = '[' + self.maybe_color('red', 'failed') + ']'
- else:
- result = '[' + self.maybe_color('yellow', info) + ']'
-
- self.captured.append( self.maybe_color('green', '* ') + i + ' ' + '.' * (58 - len(i)) \
- + ' ' + result)
-
- def warn (self, warn, level = 4):
-
- if type(warn) not in types.StringTypes:
- warn = str(warn)
-
- if level > self.warn_lev:
- return
-
- for i in warn.split('\n'):
- self.captured.append(self.maybe_color('yellow', '* ') + i)
-
-
def create_fd():
"""creates file descriptor pairs an opens them ready for
use in place of stdin, stdout, stderr.