s/skin_version/skin_semantics/g

This commit is contained in:
Tom Keffer
2018-11-26 06:00:49 -08:00
parent 0eaa61f60e
commit de8ecbb5a3
7 changed files with 27 additions and 7 deletions

View File

@@ -14,6 +14,7 @@ import os.path
import shutil
import sys
import tempfile
try:
# Python 2
from StringIO import StringIO
@@ -338,6 +339,7 @@ def update_config(config_dict):
update_to_v39(config_dict)
def merge_config(config_dict, template_dict):
"""Merge the template (distribution) dictionary into the user's dictionary.
@@ -882,9 +884,12 @@ def update_to_v32(config_dict):
config_dict['DatabaseTypes']['MySQL']['password'] = \
config_dict['Databases']['archive_mysql'].get('password', 'weewx')
config_dict['DatabaseTypes']['MySQL']['driver'] = 'weedb.mysql'
config_dict['DatabaseTypes']['MySQL'].comments['host']=[" # The host where the database is located"]
config_dict['DatabaseTypes']['MySQL'].comments['user']=[" # The user name for logging into the host"]
config_dict['DatabaseTypes']['MySQL'].comments['password']=[" # The password for the user name"]
config_dict['DatabaseTypes']['MySQL'].comments['host'] = [
" # The host where the database is located"]
config_dict['DatabaseTypes']['MySQL'].comments['user'] = [
" # The user name for logging into the host"]
config_dict['DatabaseTypes']['MySQL'].comments['password'] = [
" # The password for the user name"]
config_dict['Databases']['archive_mysql'].pop('host', None)
config_dict['Databases']['archive_mysql'].pop('user', None)
config_dict['Databases']['archive_mysql'].pop('password', None)
@@ -1276,7 +1281,7 @@ def update_skins_v39(config_dict):
continue
# No need to do anything if this skin has already been upgraded
if to_int(skin_dict.get('skin_version', 1)) >= 2:
if to_int(skin_dict.get('skin_semantics', 1)) >= 2:
continue
n_commented = 0
@@ -1295,7 +1300,9 @@ def update_skins_v39(config_dict):
print("For report '%s', %d lines were commented out" % (report, n_commented))
skin_dict['skin_version'] = 2
# Indicate that this skin.conf file has now been patched to v2 semantics
skin_dict['skin_semantics'] = 2
# Now write the patched skin configuration file, with a backup.
save_with_backup(skin_dict, skin_file)
@@ -1332,6 +1339,7 @@ def fix_defaults(defaults_dict, skin_dict_section):
return n_commented
# ==============================================================================
# Utilities that extract from ConfigObj objects
# ==============================================================================

View File

@@ -6,6 +6,8 @@
# engine to invoke FTP, which copies files to another location. #
###############################################################################
skin_semantics = 2
[Generators]
generator_list = weewx.reportengine.FtpGenerator

View File

@@ -1,5 +1,7 @@
# configuration file for Mobile skin
skin_semantics = 2
[Extras]
# Set this URL to display a radar image
#radar_img = http://radar.weather.gov/ridge/lite/N0R/RTX_loop.gif

View File

@@ -7,6 +7,8 @@
# engine to invoke rsync, which synchronizes files between two locations. #
###############################################################################
skin_semantics = 2
[Generators]
generator_list = weewx.reportengine.RsyncGenerator

View File

@@ -1,8 +1,10 @@
###############################################################################
# SEASONS SKIN CONFIGURATION FILE #
# Copyright (c) 2010 Tom Keffer <tkeffer@gmail.com> #
# Copyright (c) 2018 Tom Keffer <tkeffer@gmail.com> and Matthew Wall #
###############################################################################
skin_semantics = 2
[Extras]
# Put any extra tags here that you want to be available in the templates

View File

@@ -1,5 +1,7 @@
# configuration file for Smartphone skin
skin_semantics = 2
[Extras]
# Set this URL to display a radar image
#radar_img = http://radar.weather.gov/ridge/lite/N0R/RTX_loop.gif

View File

@@ -1,8 +1,10 @@
###############################################################################
# STANDARD SKIN CONFIGURATION FILE #
# Copyright (c) 2010-2018 Tom Keffer <tkeffer@gmail.com> #
# Copyright (c) 2010-2018 Tom Keffer <tkeffer@gmail.com> #
###############################################################################
skin_semantics = 2
[Extras]
# Put any extra tags here that you want to be available in the templates