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 ) )