-
Notifications
You must be signed in to change notification settings - Fork 1
/
abstract_mode.py
69 lines (63 loc) · 1.25 KB
/
abstract_mode.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
from abc import ABCMeta, abstractmethod
from utils import (
Client,
ClientConfig,
MyFileHandler,
MyFormatter,
MyStreamHandler,
Path,
Settings,
Sg,
box,
ceil,
chunks,
compare,
copy,
datetime,
excepthook,
floor,
format_time,
get_font_name,
get_menu_pixels,
get_rotation,
get_text,
global_settings,
hdlr,
importlib,
json,
load_font,
log,
logger,
logging,
my_emit,
os,
requests,
rfh,
set_text,
sys,
timedelta,
)
class Mode(metaclass=ABCMeta):
name = None
character_selection_enabled = True
duration_selection_enabled = True
parse_character_levels = True
def __init__(self, bot):
self.bot = bot
@property
@abstractmethod
def next_character(self):
pass
@property
@abstractmethod
def next_duration(self):
pass
@classmethod
def get_name(cls):
if isinstance(cls.name, str):
return cls.name # Shouldn't be used, here for backwards compatibility
elif isinstance(cls.name, dict):
return cls.name.get(
global_settings.language_name, cls.name.get("default", cls.__name__)
)
return cls.__name__