mirror of
https://github.com/weewx/weewx.git
synced 2026-04-19 09:06:58 -04:00
s/skin_version/skin_semantics/g
This commit is contained in:
@@ -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
|
||||
# ==============================================================================
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
# engine to invoke FTP, which copies files to another location. #
|
||||
###############################################################################
|
||||
|
||||
skin_semantics = 2
|
||||
|
||||
[Generators]
|
||||
generator_list = weewx.reportengine.FtpGenerator
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
# engine to invoke rsync, which synchronizes files between two locations. #
|
||||
###############################################################################
|
||||
|
||||
skin_semantics = 2
|
||||
|
||||
[Generators]
|
||||
generator_list = weewx.reportengine.RsyncGenerator
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user