mirror of
https://github.com/weewx/weewx.git
synced 2026-05-19 07:15:18 -04:00
debconf must be initialized before everything else. added more feedback about station and driver during engine initialization. fix copyright notice.
This commit is contained in:
@@ -81,6 +81,8 @@ class StdEngine(object):
|
||||
# Find the driver name for this type of hardware
|
||||
driver = config_dict[stationType]['driver']
|
||||
|
||||
syslog.syslog(syslog.LOG_INFO, "wxengine: Loading station type %s (%s)" % (stationType, driver))
|
||||
|
||||
# Import the driver:
|
||||
__import__(driver)
|
||||
|
||||
@@ -413,7 +415,7 @@ class StdArchive(StdService):
|
||||
syslog.syslog(syslog.LOG_INFO, "wxengine: Using station hardware archive interval of %d" % self.archive_interval)
|
||||
except NotImplementedError:
|
||||
self.archive_interval = software_archive_interval
|
||||
syslog.syslog(syslog.LOG_INFO, "wxengine: Using archive interval of %d from config file" % self.archive_interval)
|
||||
syslog.syslog(syslog.LOG_INFO, "wxengine: Using config file archive interval of %d" % self.archive_interval)
|
||||
|
||||
self.archive_delay = config_dict['StdArchive'].as_int('archive_delay')
|
||||
if self.archive_delay <= 0:
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#!/usr/bin/env python
|
||||
# $Id$
|
||||
# Copyright Matthew Wall
|
||||
# Copyright (c) 2009-2013 Tom Keffer <tkeffer@gmail.com>
|
||||
"""weewx configuration file upgrade script. Use this script to merge new
|
||||
features into an existing configuration file. The script takes two
|
||||
configuration files as input then outputs the merged contents of those
|
||||
files."""
|
||||
features into an existing configuration file. The script takes an
|
||||
installation directory and two configuration files as input then outputs
|
||||
the merged contents of the input files.
|
||||
|
||||
The weewx setup.py script must be in the same directory as this script."""
|
||||
|
||||
import setup
|
||||
import configobj
|
||||
@@ -35,7 +37,7 @@ def main():
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
if options.version:
|
||||
print setup.getversion()
|
||||
print setup.get_version()
|
||||
exit(0)
|
||||
|
||||
errmsg = []
|
||||
|
||||
@@ -15,14 +15,14 @@
|
||||
# abort if any command returns error
|
||||
set -e
|
||||
|
||||
# get debconf stuff so we can set configuration defaults
|
||||
. /usr/share/debconf/confmodule
|
||||
|
||||
cfgfile=/etc/weewx/weewx.conf
|
||||
mergeapp=/usr/share/weewx/merge_config.py
|
||||
|
||||
# insert any configuration variables into the configuration file
|
||||
configure_weewxconf() {
|
||||
# get debconf stuff so we can set configuration defaults
|
||||
. /usr/share/debconf/confmodule
|
||||
|
||||
db_get weewx/location
|
||||
sed -i "s%location =.*%location = \"$RET\"%" $cfgfile
|
||||
|
||||
@@ -92,6 +92,7 @@ merge_weewxconf() {
|
||||
fi
|
||||
else
|
||||
# this is a new config, so just insert debconf values into it
|
||||
echo using debconf configuration values from previous install
|
||||
configure_weewxconf
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user