def __init__(self, config):
self.service = None
self.webServer = None
self.config = config
self.httpsPort = int(self.config.get('web', 'httpsPort'))
self.httpPort = int(self.config.get('web', 'httpPort'))
self.adminPasswordHash = self.config.get('web', 'adminPasswordHash')
self.apiSecret = self.config.get('web', 'apiSecret')
self.uploadDir = self.config.get('web', 'uploadDir')
self.dbFile = self.config.get('web', 'dbFile')
self.httpsCertFile = self.config.get('web', 'httpsCertFile')
self.httpsKeyFile = self.config.get('web', 'httpsKeyFile')
self.httpsChainFile = self.config.get('web', 'httpsChainFile')
self.localVideoPort = int(self.config.get('web', 'localVideoPort'))
dir = os.path.dirname(os.path.realpath(sys.argv[0]))
self.database = database.Database(self.dbFile)
self.deviceConfig = dict()
for deviceId, jsonConf in dict(self.config.items('devices')).iteritems():
self.deviceConfig[deviceId] = json.loads(jsonConf, object_pairs_hook=OrderedDict)
self.trends = dict()
self.lock = threading.Lock()
评论列表
文章目录