diff options
author | Bruno Wagner Goncalves <bwagner@thoughtworks.com> | 2014-09-03 18:05:39 -0300 |
---|---|---|
committer | Bruno Wagner Goncalves <bwagner@thoughtworks.com> | 2014-09-03 18:06:06 -0300 |
commit | c54674c20aa9bd746d967044ac8cd29788d87f93 (patch) | |
tree | 568372a083a415555ffc4faa3d82de7f273d4a13 /py-fake-service/app/adapter/tagsset.py | |
parent | 2da2783e2ee984d37b66807c57b1ae9d41750ff4 (diff) |
The mailset is not automatically loaded on startup, you can use an csv file as mailset
Diffstat (limited to 'py-fake-service/app/adapter/tagsset.py')
-rw-r--r-- | py-fake-service/app/adapter/tagsset.py | 7 |
1 files changed, 5 insertions, 2 deletions
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() |