Commit 320022e4 authored by Cédric Bonhomme's avatar Cédric Bonhomme

It is now possible to configure the tools with a file.

parent 428513e7
#! /usr/bin/env python
#-*- coding: utf-8 -*-
""" Program variables.
This file contain the variables used by the application.
"""
import os, sys
try:
import configparser as confparser
except:
import ConfigParser as confparser
# load the configuration
config = confparser.SafeConfigParser()
config.read("./conf/conf.cfg")
PATH = os.path.abspath(".")
DATABASE_NAME = config.get('database', 'name')
DATABASE_PORT = int(config.get('database', 'port'))
DATABASE_ADDRESS = config.get('database', 'address')
#DATABASE_USERNAME = config.get('database', 'username')
#DATABASE_PASSWORD = config.get('database', 'password')
WEBSERVER_DEBUG = int(config.get('webserver', 'debug')) == 1
WEBSERVER_HOST = config.get('webserver', 'host')
WEBSERVER_PORT = int(config.get('webserver', 'port'))
\ No newline at end of file
[database]
name = epcservice
address = 127.0.0.1
port = 27017
[webserver]
debug = 1
host = 0.0.0.0
port = 5000
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment