Initial import
This commit is contained in:
40
app/enums.py
Normal file
40
app/enums.py
Normal file
@@ -0,0 +1,40 @@
|
||||
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"
|
||||
Reference in New Issue
Block a user