You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
944 B
23 lines
944 B
g_telegram_bot_api_token = '' |
|
# --------------------------------------------------------- |
|
# Файлы для настройки, которые не коммитятся в git |
|
telegram_bot_api_token_file_name = 'config_telegram_bot_api_token' |
|
# --------------------------------------------------------- |
|
# Дополнительные функции |
|
def GetFirstLineFromFile(a_FileName): |
|
f = open(a_FileName, 'r') |
|
result = f.readline() |
|
f.close() |
|
return result |
|
def GetAllLinesFromFile(a_FileName): |
|
f = open(a_FileName, 'r') |
|
result = f.readlines() |
|
f.close() |
|
return result |
|
# --------------------------------------------------------- |
|
# Основные функции |
|
def GetTelegramBotApiToken(): |
|
global g_telegram_bot_api_token |
|
if len(g_telegram_bot_api_token) == 0: |
|
g_telegram_bot_api_token = str().strip(GetFirstLineFromFile(telegram_bot_api_token_file_name)) |
|
return g_telegram_bot_api_token |