More output stuff.

This commit is contained in:
Bastian Kleineidam 2013-04-30 07:24:54 +02:00
parent ab61606bdb
commit 5f6ed7e05d
3 changed files with 4 additions and 6 deletions

4
dosage
View file

@ -288,9 +288,7 @@ def doList(columnList=True, verbose=False):
"""List available comics.""" """List available comics."""
page = hasattr(sys.stdout, "isatty") and sys.stdout.isatty() page = hasattr(sys.stdout, "isatty") and sys.stdout.isatty()
if page: if page:
fd = StringIO() fd = StringIO(u'')
else:
fd = sys.stdout
out.setStream(fd) out.setStream(fd)
out.info(u'Available comic scrapers:') out.info(u'Available comic scrapers:')
out.info(u'Comics tagged with [%s] require age confirmation with the --adult option.' % TAG_ADULT) out.info(u'Comics tagged with [%s] require age confirmation with the --adult option.' % TAG_ADULT)

View file

@ -1,5 +1,5 @@
# -*- coding: iso-8859-1 -*- # -*- coding: iso-8859-1 -*-
# Copyright (C) 2000-2012 Bastian Kleineidam # Copyright (C) 2000-2013 Bastian Kleineidam
""" """
ANSI Color definitions and functions. For Windows systems, the colorama module ANSI Color definitions and functions. For Windows systems, the colorama module
uses ctypes and Windows DLLs to generate colored output. uses ctypes and Windows DLLs to generate colored output.

View file

@ -26,11 +26,11 @@ class Output(object):
self.encoding = 'utf-8' self.encoding = 'utf-8'
else: else:
self.encoding = encoding self.encoding = encoding
stream = codecs.getwriter(self.encoding)(stream)
self.setStream(stream) self.setStream(stream)
def setStream(self, stream): def setStream(self, stream):
"""Initialize context and indentation.""" """Initialize context and indentation."""
stream = codecs.getwriter(self.encoding)(stream)
self.stream = Colorizer(stream) self.stream = Colorizer(stream)
def info(self, s, level=0): def info(self, s, level=0):