-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
51 lines (42 loc) · 1.4 KB
/
config.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from configparser import ConfigParser
import ast
####Hier wird die Config aus dem Configfile geladen und den einzelen
####Werten zugewiesen
class Config():
host = ""
port = ""
database = ""
user = ""
password = ""
token = ""
chatId = ""
chatUrl = ""
singlechatId = ""
singlechatUrl = ""
language = ""
venue = bool
areaName = ""
areaNumber = ""
fence = ""
sleepTime = ""
def readConfig(self,cfgFile):
parser = ConfigParser()
parser.read(cfgFile, encoding='utf-8')
self.host = parser.get('Mysql', 'host')
self.port = parser.getint('Mysql', 'port')
self.database = parser.get('Mysql', 'database')
self.user = parser.get('Mysql', 'user')
self.password = parser.get('Mysql', 'password')
self.token = parser.get('Bot Settings', 'token')
self.chatId = parser.get('Bot Settings', 'chat_id')
self.chatUrl = parser.get('Bot Settings', 'chat_url')
self.singlechatId = parser.get('Bot Settings', 'singlechat_id')
self.singlechatUrl = parser.get('Bot Settings', 'singlechat_url')
self.language = parser.get('Option', 'language')
self.venue = parser.getboolean('Option', 'venue')
self.areaName = parser.get('Geofence', 'areaName')
self.areaNumber = parser.get('Geofence', 'areaNumber')
self.fence = parser.get('Geofence', 'fence')
self.sleepTime = parser.get('Message', 'sleep_time')