-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhelpers.py
51 lines (41 loc) · 1.01 KB
/
helpers.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from typing import List, Tuple
from enum import Enum, unique
@unique
class Collections(str, Enum):
ATTENDEES = "attendees"
DECLINERS = "decliners"
DREAMERS = "dreamers"
CANCELLERS = "cancellers"
INVENTORIES = "inventories"
CONFIG = "config"
PLAYERS = "players"
@unique
class Weekdays(int, Enum):
MONDAY = 0
TUESDAY = 1
WENDESAY = 2
THURSDAY = 3
FRIDAY = 4
SATURDAY = 5
SUNDAY = 6
@unique
class Emojis(str, Enum):
MONDAY = "🇲"
TUESDAY = "🇹"
WENDESAY = "🇼"
THURSDAY = "🇷"
FRIDAY = "🇫"
SATURDAY = "🇸"
SUNDAY = "🇺"
def plist(inlist: List) -> str:
if len(inlist) > 0:
return ", ".join([u["name"] for u in inlist])
else:
return "None"
def adjacent_days(dotw: int) -> Tuple[int, int]:
if dotw < 0 or dotw > 6:
raise ValueError
days = [i for i in range(len(Weekdays))]
before = days[(dotw - 1) % len(days)]
after = days[(dotw + 1) % len(days)]
return (int(before), int(after))