This repository has been archived by the owner on May 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.py
177 lines (146 loc) · 6.36 KB
/
constants.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
import os
# Константы - пороли
class ConstantsToken:
T_BOT_API_TOKEN = ""
TMBD_API_TOKEN = str(os.environ.get("TMDB_TOKEN"))
TEST_API_TOKEN = str(os.environ.get('ACCSESS_TOKEN'))
class Smiles:
HEART = '❤'
THINKING = '🤔'
HAPPY = '☺'
VERY_HAPPY = '😄'
LIKE = '👍'
ARROW_LEFT = '⬅'
ARROW_RIGHT = "➡"
LUPA = '🔎'
KINO = '📽️'
LAMP = '💡'
LETTER = '📰'
FIRE='🔥'
GAME = '🎮'
TOP = '🎬'
MAP = '🗺️'
YEAR = '📅'
SETTINGS = '🛠'
WAR = '🔫'
WEST = '🌵'
DETECTIVE = '🕵️'
DRAMA = '🎭'
HISTORY = '📜'
COMEDY = '🤡'
TRILLER = '🧟'
FANTASTIC = '🔮'
ACTOR = '🤓'
DESCRIPTION = '🎞️'
NOONE_UNDER_EIGHTEEN = "🔞"
STAR = "🌟"
THUMBS_UP = "👍"
THUMBS_DOWN = "👎"
SOON = "🔜"
BROKEN_HEART = "💔"
class Commands:
COMPLITE_SEARCH = Smiles.LUPA + " Выполнить поиск"
SETTING_COMMAND = Smiles.SETTINGS + " Настройки"
GET_BACK_COMMAND = Smiles.ARROW_LEFT + " Назад"
USER_FAVORITE_COMMAND = Smiles.HEART + " Мои избранные"
UPCOMING_FILMS_COMMAND = Smiles.YEAR + " Сейчас идут"
COUNTRIES_COMMAND = Smiles.MAP + " Страны"
SEARCH_FILM_COMMAND = Smiles.LUPA + " Найти фильм"
SEARCH_FILM_BY_ACTOR = Smiles.ACTOR + 'Найди фильм по актеру'
NEWS_COMMAND = Smiles.LETTER + " Новости кино"
GAME_COMMAND = Smiles.GAME + " Игры"
TOP_FILMS_COMMAND = Smiles.TOP + ' Топ 10'
YEAR_COMMAND = Smiles.YEAR + " Год"
GENRE_COMMAND = "Жанр"
GENRE_HISTORY_COMMAND = Smiles.HISTORY + ' История'
GENRE_BLOCKBASTER_COMMAND = Smiles.WAR + " Боевик"
GENRE_FANTASTIC_COMMAND = Smiles.FANTASTIC + ' Фантастика'
GENRE_DRAMA_COMMAND = Smiles.DRAMA + " Драма"
GENRE_DETECTIVE_COMMAND = Smiles.DETECTIVE + " Детектив"
GENRE_MELODRAMA_COMMAND = Smiles.HEART + " Мелодрама"
GENRE_COMEDY_COMMAND = Smiles.COMEDY + " Комедия"
GENRE_TRILLER_COMMAND = Smiles.TRILLER + " Триллер"
GENRE_WEST_COMMAND = Smiles.WEST + " Вестрен"
GAME_TRUE_OR_FALSE_COMMAND = Smiles.DRAMA + " Правда или ложь"
GAME_GUESS_FILM = Smiles.DESCRIPTION + " Угадай фильм"
CLEAR_SETTINGS_COMMAND = Smiles.SETTINGS + ' Убрать настройки'
POPULAR_FILMS_COMMAND = Smiles.FIRE + " Популярные"
# CallbackQuery
NEXT_PAGE_COMMAND = "next_page"
PREV_PAGE_COMMAND = "prev_page"
NEW_LIKE_COMMAND = "new_like"
NEW_DISLIKE_COMMAND = "new_dislike"
OPEN_GENRES_COMMAND = "open_genres"
OPEN_YEARS_COMMAND = "open_years"
OPEN_COUNTRIES_COMMAND = "open_countries"
COMPLITE_SEARCH_COOMMAND_INLINE = "do_search"
ADD_FAVORITE_COMMAND = r"add_favorite-(?P<film_id>[0-9]*)"
ID_FILM_RE = r'/f(?P<film_id>[0-9]*)'
ID_GENRE_RE = r'add_genre-(?P<genre_id>[0-9]*)'
DEL_FAVORITE_COMMAND = r"del_favorite-(?P<film_id>[0-9]*)"
class ConstantsAnswers:
GREETING_MSG = "✌ Привет!\n🎥 Чтобы найти фильм, просто введи его название.\n"
GREETING_MSG += "👥 Для того, чтобы использовать меня в группе, воспользуйся: @SearchMovieBot /название Фильма/"
FILM_NOT_FOUNDED_EDITABLE = Smiles.THINKING + ' По запросу _"{0}"_ ничего не найдено. '
NO_FAVORITE_FILMS = Smiles.THINKING + " * Вы не добавили избранных фильмов *"
SEARCH_MSG = " Поиск по заданным параментрам: "
def format_film_text(self, **text_params):
# Форматирует текст по фильму в стандартный вид
pass
class Genres:
dict_of_genres = {'Детектив': 9648, 'История': 36,
'Триллер': 53, 'Вестерн': 37,
'Приключения': 12, 'Документальный': 99,
'Мультфильм': 16, 'Боевик': 28,
'Семейный': 10751, 'Драма': 18,
'Военный': 10752, 'Комедия': 35,
'Мелодрама': 10749,
'Музыка': 10402, 'Криминал': 80, 'Ужасы': 27, 'Фэнтези': 14, 'Фантастика': 878}
num_dict_of_genres = {
10752: 'Военный', 9648: 'Детектив', 10402: 'Музыка', 35: 'Комедия', 36: 'История', 878: 'Фантастика',
80: 'Криминал', 12: 'Приключения', 10770: 'Телевизионный фильм', 14: 'Фэнтези', 16: 'Мультфильм', 18: 'Драма',
99: 'Документальный', 53: 'Триллер', 10751: 'Семейный', 27: 'Ужасы', 28: 'Боевик', 10749: 'Мелодрама',
37: 'Вестерн'
}
class LoggerConfig:
dictLogConfig = {
"version": 1,
"handlers": {
"fileHandler": {
"class": "logging.FileHandler",
"formatter": "myFormatter",
"filename": "db.log"
},
"consoleHandler": {
"class": "logging.StreamHandler",
"formatter": "consoleFormatter"
},
"fileHandlerOther":{
"class": "logging.FileHandler",
"formatter": "myFormatter",
"filename": "chat_logs.log"
}
},
"loggers": {
"file_logger": {
"handlers": ["fileHandler", "consoleHandler"],
"level": "INFO",
},
"console_logger": {
"handlers": ["consoleHandler", "fileHandler"],
"level": "DEBUG"
},
"db_logger": {
"handlers": ["fileHandler", "consoleHandler"],
"level": "DEBUG"
}
},
"formatters": {
"myFormatter": {
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
},
"consoleFormatter":{
"format": "%(lineno)d | %(asctime)s - %(filename)s - %(name)s - %(levelname)s - %(message)s"
}
}
}