Files
daily-counter/app/enums.py

40 lines
990 B
Python
Raw Normal View History

2026-03-31 19:09:37 +02:00
from enum import IntEnum, Enum
class CounterType(IntEnum):
SIMPLE = 1
DAILY = 2
WEEKLY = 3
MONTHLY = 4
YEARLY = 5
def current_unit_text(self):
match self:
case CounterType.DAILY:
return 'today'
case CounterType.WEEKLY:
return 'this week'
case CounterType.MONTHLY:
return 'this month'
case CounterType.YEARLY:
return 'this year'
case _:
return 'times'
def previous_unit_text(self):
match self:
case CounterType.DAILY:
return 'yesterday'
case CounterType.WEEKLY:
return 'last week'
case CounterType.MONTHLY:
return 'last month'
case CounterType.YEARLY:
return 'last year'
case _:
return 'times'
class Tabs(Enum):
COUNTERS ="Counters"
STATISTICS = "Stats"