config in ini
This commit is contained in:
@@ -25,6 +25,7 @@ import datetime
|
||||
import serial
|
||||
import simplejson as json
|
||||
import influxdb
|
||||
import configparser
|
||||
|
||||
# optionally, future modules, locally available, I hate dependencies
|
||||
from pprint import pprint
|
||||
@@ -40,6 +41,9 @@ sys.path.append(_SCRIPT_PATH + "/lib")
|
||||
Define variables
|
||||
--------------------------------------------------------------------------------
|
||||
'''
|
||||
config = configparser.ConfigParser()
|
||||
config.read(_SCRIPT_PATH + "/../web/config/plutonium.ini")
|
||||
|
||||
_VERSION = 2.0
|
||||
_NAME = u"Vantage Vue Decoding shite"
|
||||
_LOG_DIR = _SCRIPT_PATH + '/log/'
|
||||
@@ -64,12 +68,13 @@ rain = 0
|
||||
influx_status_write = []
|
||||
influx_weather_write = []
|
||||
|
||||
influx_host = 'localhost'
|
||||
influx_port = 8086
|
||||
influx_user = 'pi'
|
||||
influx_pwd = 'Ventil6996'
|
||||
weather_db = 'weather_v2'
|
||||
status_db = 'status'
|
||||
influx_host = config['InfluxDB']['_influx_host']
|
||||
influx_port = config['InfluxDB']['_influx_port']
|
||||
influx_user = config['InfluxDB']['_influx_user']
|
||||
influx_pwd = config['InfluxDB']['_influx_pwd']
|
||||
weather_db = config['InfluxDB']['_influx_weather_db']
|
||||
status_db = config['InfluxDB']['_influx_status_db']
|
||||
|
||||
|
||||
'''
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@@ -37,6 +37,8 @@ import datetime
|
||||
import serial
|
||||
import simplejson as json
|
||||
import influxdb
|
||||
import configparser
|
||||
|
||||
|
||||
# optionally, future modules, locally available, I hate dependencies
|
||||
from pprint import pprint
|
||||
@@ -51,6 +53,9 @@ sys.path.append(_SCRIPT_PATH + "/lib")
|
||||
Define variables
|
||||
--------------------------------------------------------------------------------
|
||||
'''
|
||||
config = configparser.ConfigParser()
|
||||
config.read(_SCRIPT_PATH + "/../web/config/plutonium.ini")
|
||||
|
||||
_VERSION = 1.0
|
||||
_NAME = u"Vantage Vue external measure enrichment"
|
||||
_LOG_DIR = _SCRIPT_PATH + '/log/'
|
||||
@@ -67,11 +72,12 @@ pressure_adjusted = 0
|
||||
|
||||
influx_weather_write = []
|
||||
|
||||
influx_host = 'localhost'
|
||||
influx_port = 8086
|
||||
influx_user = 'pi'
|
||||
influx_pwd = 'Ventil6996'
|
||||
weather_db = 'weather_v2'
|
||||
influx_host = config['InfluxDB']['_influx_host']
|
||||
influx_port = config['InfluxDB']['_influx_port']
|
||||
influx_user = config['InfluxDB']['_influx_user']
|
||||
influx_pwd = config['InfluxDB']['_influx_pwd']
|
||||
weather_db = config['InfluxDB']['_influx_weather_db']
|
||||
status_db = config['InfluxDB']['_influx_status_db']
|
||||
|
||||
'''
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@@ -24,6 +24,7 @@ import simplejson as json
|
||||
import influxdb
|
||||
import psutil
|
||||
import socket
|
||||
import configparser
|
||||
|
||||
# optionally, future modules, locally available, I hate dependencies
|
||||
from pprint import pprint
|
||||
@@ -40,8 +41,11 @@ _hostname = socket.gethostname()
|
||||
Define variables
|
||||
--------------------------------------------------------------------------------
|
||||
'''
|
||||
config = configparser.ConfigParser()
|
||||
config.read(_SCRIPT_PATH + "/../web/config/plutonium.ini")
|
||||
|
||||
_VERSION = 2.0
|
||||
_NAME = u"Vantage Vue Decoding shite"
|
||||
_NAME = u"System statistics for RasPi"
|
||||
_LOG_DIR = _SCRIPT_PATH + '/log/'
|
||||
_LOG_FILE_ROOT = re.sub(u'./', '', sys.argv[0])
|
||||
_LOG_FILE = _LOG_DIR + _LOG_FILE_ROOT + u'.log'
|
||||
@@ -49,11 +53,12 @@ _DEBUG_FILE = _LOG_DIR + _LOG_FILE_ROOT + u'.dbg'
|
||||
|
||||
influx_status_write = []
|
||||
|
||||
influx_host = 'localhost'
|
||||
influx_port = 8086
|
||||
influx_user = 'pi'
|
||||
influx_pwd = 'Ventil6996'
|
||||
status_db = 'status'
|
||||
influx_host = config['InfluxDB']['_influx_host']
|
||||
influx_port = config['InfluxDB']['_influx_port']
|
||||
influx_user = config['InfluxDB']['_influx_user']
|
||||
influx_pwd = config['InfluxDB']['_influx_pwd']
|
||||
status_db = config['InfluxDB']['_influx_status_db']
|
||||
|
||||
|
||||
'''
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user