forked from stphprom/StopTypes
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.py
45 lines (37 loc) · 1.3 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from configparser import ConfigParser
class Config():
host = ""
database = ""
user = ""
password = ""
rocketStops = bool
lureModule = bool
token = ""
singlechatId = ""
singlechatUrl = ""
chatId = ""
chatUrl = ""
areaName = ""
areaNumber = ""
sleep_time = 0
newMessageAfter = 0
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.rocketStops = parser.getboolean("Options", "rocketStops")
self.lureModule = parser.getboolean("Options", "lureModule")
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.areaNumber = parser.get('Geofence', 'areaNumber')
self.sleep_time = parser.get('Message', 'sleep_time')
self.newMessageAfter = parser.get('Message', 'newMessageAfter')