Added the Renderable mixin because DRY

This commit is contained in:
Daniel Quinn
2016-02-11 22:05:38 +00:00
parent ef1639208c
commit 7aadab23cc
5 changed files with 27 additions and 23 deletions

View File

@@ -7,9 +7,10 @@ from django.core.management.base import BaseCommand, CommandError
from ...consumer import Consumer, ConsumerError
from ...mail import MailFetcher, MailFetcherError
from ...mixins import Renderable
class Command(BaseCommand):
class Command(Renderable, BaseCommand):
"""
On every iteration of an infinite loop, consume what we can from the
consumption directory, and fetch any mail available.
@@ -62,7 +63,3 @@ class Command(BaseCommand):
delta = self.mail_fetcher.last_checked + self.MAIL_DELTA
if delta > datetime.datetime.now():
self.mail_fetcher.pull()
def _render(self, text, verbosity):
if self.verbosity >= verbosity:
print(text)