Added and implemented a rudimentary logger

This commit is contained in:
Daniel Quinn
2016-02-14 16:09:52 +00:00
parent 88acf50fe0
commit 7843ea5037
14 changed files with 142 additions and 36 deletions

View File

@@ -7,10 +7,9 @@ from django.core.management.base import BaseCommand, CommandError
from ...consumer import Consumer, ConsumerError
from ...mail import MailFetcher, MailFetcherError
from ...mixins import Renderable
class Command(Renderable, BaseCommand):
class Command(BaseCommand):
"""
On every iteration of an infinite loop, consume what we can from the
consumption directory, and fetch any mail available.

View File

@@ -46,7 +46,7 @@ class Command(Renderable, BaseCommand):
target = os.path.join(self.target, document.parseable_file_name)
self._render("Exporting: {}".format(target), 1)
print("Exporting: {}".format(target))
with open(target, "wb") as f:
f.write(GnuPG.decrypted(document.source_file))

View File

@@ -27,6 +27,5 @@ class Command(Renderable, BaseCommand):
pk__in=document.tags.values_list("pk", flat=True))
for tag in tags:
if tag.matches(document.content):
self._render(
'Tagging {} with "{}"'.format(document, tag), 1)
print('Tagging {} with "{}"'.format(document, tag))
document.tags.add(tag)