From c36f625a54e7a99a49462ce64df9d996a18f741f Mon Sep 17 00:00:00 2001 From: volpino Date: Mon, 28 May 2012 23:24:09 +0200 Subject: [PATCH] euscanwww: fixing colored output Signed-off-by: volpino --- euscanwww/djeuscan/management/commands/scan_metadata.py | 5 +++-- euscanwww/djeuscan/management/commands/scan_portage.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/euscanwww/djeuscan/management/commands/scan_metadata.py b/euscanwww/djeuscan/management/commands/scan_metadata.py index c8e926a..8590412 100644 --- a/euscanwww/djeuscan/management/commands/scan_metadata.py +++ b/euscanwww/djeuscan/management/commands/scan_metadata.py @@ -15,6 +15,7 @@ from djeuscan.models import Package, Herd, Maintainer class ScanMetadata(object): def __init__(self, quiet): self.quiet = quiet + self.style = color_style() @commit_on_success def run(self, query=None, obj=None): @@ -25,7 +26,7 @@ class ScanMetadata(object): if not matches: sys.stderr.write( - color_style.ERROR("Unknown package '%s'\n" % query) + self.style.ERROR("Unknown package '%s'\n" % query) ) return @@ -46,7 +47,7 @@ class ScanMetadata(object): obj.description = pkg.environment("DESCRIPTION") except GentoolkitFatalError, err: sys.stderr.write( - color_style.ERROR( + self.style.ERROR( "Gentoolkit fatal error: '%s'\n" % str(err) ) ) diff --git a/euscanwww/djeuscan/management/commands/scan_portage.py b/euscanwww/djeuscan/management/commands/scan_portage.py index 58997ad..4227501 100644 --- a/euscanwww/djeuscan/management/commands/scan_portage.py +++ b/euscanwww/djeuscan/management/commands/scan_portage.py @@ -21,6 +21,7 @@ class ScanPortage(object): self.stdout = stdout self.options = options + self.style = color_style() self._cache = {'packages': {}, 'versions': {}} self._overlays = None @@ -117,7 +118,7 @@ class ScanPortage(object): Package.objects.filter(name=query).delete() else: sys.stderr.write( - color_style.ERROR( + self.style.ERROR( "Unknown package '%s'\n" % query ) )