Anton
1 year ago
7 changed files with 46 additions and 19 deletions
@ -0,0 +1,25 @@ |
|||||||
|
g_telegram_bot_api_token = '' |
||||||
|
# --------------------------------------------------------- |
||||||
|
# Файлы для настройки, которые не коммитятся в git |
||||||
|
telegram_bot_api_token_file_name = 'config_telegram_bot_api_token' |
||||||
|
# --------------------------------------------------------- |
||||||
|
# Дополнительные функции |
||||||
|
def ClearReadLine(a_Line): |
||||||
|
return a_Line[:-1] |
||||||
|
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 = ClearReadLine(GetFirstLineFromFile(telegram_bot_api_token_file_name)) |
||||||
|
return g_telegram_bot_api_token |
Loading…
Reference in new issue