summaryrefslogtreecommitdiff
path: root/py-fake-service/app/adapter/tag.py
blob: c982f52489c42eef83dd40156a47d33ca263b5b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class Tag:
    DEFAULT_TAGS = ["inbox", "sent", "trash", "drafts"]

    def __init__(self, name, ident):
        self.counts = {
            'total': 1,
            'read': 0,
            'starred': 0,
            'reply': 0
        }

        self.ident = ident
        self.name = name.lower()
        self.default = name in self.DEFAULT_TAGS

    def increment_count(self):
        self.counts['total'] += 1

    def increment_read(self):
        self.counts['read'] += 1

    def decrement_count(self):
        self.counts['total'] -= 1