Coverage for otaku_info/Config.py: 100%

Shortcuts on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

10 statements  

1"""LICENSE 

2Copyright 2020 Hermann Krumrey <hermann@krumreyh.com> 

3 

4This file is part of otaku-info. 

5 

6otaku-info is free software: you can redistribute it and/or modify 

7it under the terms of the GNU General Public License as published by 

8the Free Software Foundation, either version 3 of the License, or 

9(at your option) any later version. 

10 

11otaku-info is distributed in the hope that it will be useful, 

12but WITHOUT ANY WARRANTY; without even the implied warranty of 

13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

14GNU General Public License for more details. 

15 

16You should have received a copy of the GNU General Public License 

17along with otaku-info. If not, see <http://www.gnu.org/licenses/>. 

18LICENSE""" 

19 

20from typing import Type 

21from jerrycan.Config import Config as BaseConfig 

22from bokkichat.connection.impl.TelegramBotConnection import \ 

23 TelegramBotConnection 

24 

25 

26class Config(BaseConfig): 

27 """ 

28 Configuration for the flask application 

29 """ 

30 

31 TELEGRAM_API_KEY: str 

32 """ 

33 API Key for the telegram bot used for notification messages 

34 """ 

35 

36 TELEGRAM_BOT_CONNECTION: TelegramBotConnection 

37 """ 

38 Single Telegram bot connection used for all telegram communications 

39 """ 

40 

41 @classmethod 

42 def _load_extras(cls, parent: Type[BaseConfig]): 

43 """ 

44 Loads non-standard configuration variables 

45 :param parent: The base configuration 

46 :return: None 

47 """ 

48 from otaku_info.template_extras import profile_extras 

49 parent.TEMPLATE_EXTRAS.update({ 

50 "profile": profile_extras 

51 })