From c54674c20aa9bd746d967044ac8cd29788d87f93 Mon Sep 17 00:00:00 2001 From: Bruno Wagner Goncalves Date: Wed, 3 Sep 2014 18:05:39 -0300 Subject: The mailset is not automatically loaded on startup, you can use an csv file as mailset --- py-fake-service/app/adapter/tagsset.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'py-fake-service/app/adapter/tagsset.py') diff --git a/py-fake-service/app/adapter/tagsset.py b/py-fake-service/app/adapter/tagsset.py index b56fc4f8..8e0d7ca3 100644 --- a/py-fake-service/app/adapter/tagsset.py +++ b/py-fake-service/app/adapter/tagsset.py @@ -18,12 +18,15 @@ from tag import Tag class TagsSet: + DEFAULT_TAGS = ["inbox", "sent", "trash", "drafts"] + def __init__(self): - self.tags = {} self.ident = 0 + self.tags = {} + self.tags = {tag: self._create_new_tag(tag) for tag in self.DEFAULT_TAGS} def add(self, mbox_mail): - tags = mbox_mail.get('X-TW-Pixelated-Tags').split(', ') + tags = filter(len, mbox_mail.get('X-TW-Pixelated-Tags').split(', ')) for tag in tags: tag = self._create_new_tag(tag) tag.increment_count() -- cgit v1.2.3