forked from Micha854/questReport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
48 lines (40 loc) · 1.37 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
#!/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 = ""
database = ""
user = ""
password = ""
token = ""
singlechatId = ""
singlechatUrl = ""
chatId = ""
chatUrl = ""
areaName = ""
min_latitude = ""
max_latitude = ""
min_longitude = ""
max_longitude = ""
sleepTime = ""
def readConfig(self,cfgFile):
parser = ConfigParser()
parser.read(cfgFile, encoding='utf-8')
self.host = parser.get('Mysql', 'host')
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.singlechatId = parser.get('Bot Settings', 'singlechat_id')
self.singlechatUrl = parser.get('Bot Settings', 'singlechat_url')
self.chatId = parser.get('Bot Settings', 'chat_id')
self.chatUrl = parser.get('Bot Settings', 'chat_url')
self.areaName = parser.get('Geofence', 'areaName')
self.min_latitude = parser.get('Geofence', 'minLat')
self.max_latitude = parser.get('Geofence', 'maxLat')
self.min_longitude = parser.get('Geofence', 'minLon')
self.max_longitude = parser.get('Geofence', 'maxLon')
self.sleepTime = parser.get('Message', 'sleep_time')