diff --git a/CHANGES.txt b/CHANGES.txt index 165e5c92..e65074ee 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,6 +8,16 @@ now does a better job for ranges less than 1.0. The user can also hardwire in min and max values, as well as specify a minimum increment, through parameter 'yscale' in section [Images] in the configuration file. +Rain year is now parameterized in file templates/year.tmpl (instead of +being hardwired in). + +Now does LOOP caching by default. + +When doing backfilling to the stats database, configure now creates the stats +database if it doesn't already exist. + +setup.py now more robust to upgrading the FTP and Wunderground sections + 1.1.0 11/14/09 diff --git a/readme.htm b/readme.htm index 673ee202..983d2ca0 100644 --- a/readme.htm +++ b/readme.htm @@ -529,16 +529,6 @@ year starts in October (as mine does). Default is 1.
This variable is available in the HTML templates. Set it to an appropriate URL to display a radar image for your area. No default.
-Set to 1 (one) to cache LOOP data, otherwise, set to zero. By default, -weewx updates the statistical database with every LOOP -update. This can be as often as every two seconds. If you are using a solid-state -disk as your permanent store, this can result in a lot of wear on the device. By -setting cache_loop_data to 1, the LOOP data will be cached, -and the stats database will be updated only when new archive data is due. This results -in many fewer writes to the database, but possible loss of data should your server -go down between archive updates. (The only data actually lost would be any new High/Lows -found during the archive period.) The default is 0 (no caching).
Set to the base temperature for calculating heating and cooling degree-days, @@ -546,6 +536,10 @@ respectively. The default is 65.0 for both.
Set to suitable abbreviations for the four hemispheres. Default is "N", "S", "E", "W"
+Set to 1 (one) to cache LOOP data, otherwise, set to zero. Most users will +not want to change this unless you have a specialized application. Default is 1 +(cache LOOP data).
Set to the type of hardware you are using. For this version, only 'VantagePro' is accepted. Required.
@@ -598,8 +592,7 @@ only Imperial. In any case, Imperial is the only system supported by weewx can FTP them for you. It does an incremental update, that is, it only FTPs any files that have changed, saving outgoing bandwidth with your Internet connection. -If you do not use such a server, comment out the entire section, including the -'[FTP]' heading.
+If you do not use such a server, comment out the first four options below.
user
Set to the username you use for your FTP connection to your web server. Required. No default.
@@ -611,7 +604,8 @@ No default. www.threefools.org, in my case). Required. No defaultpath
Set to the path where the weather data will be stored on your webserver (e.g., -'weather'). Required. No default.
+'/weather'). NB: some FTP servers require a +leading slash ('/'), some don't. Required. No default.Set to 1 if you wish to use the more modern, FTP passive mode, 0 if you wish to use active mode. Passive mode generally works better through firewalls, but not @@ -623,9 +617,8 @@ mode).
Weewx will try up to this many times to FTP a file up to your server before giving up. Default is 3.
Weewx can send your current data to the Weather Underground. -If you do not wish to do this, comment out the entire section, including the '[Wunderground]' -heading.
+Weewx can send your current data to the Weather +Underground. If you do not wish to do this, comment out the two options below.
Set to your Weather Underground station ID (e.g., KORHOODR3). Required.
diff --git a/setup.py b/setup.py index 034df9c7..00e77fcf 100755 --- a/setup.py +++ b/setup.py @@ -26,8 +26,8 @@ In addition to the normal setup script duties, this script does the following: - 1. When building a source distribution ('sdist') it filters out username - and password information from the configuration file weewx.conf + 1. When building a source distribution ('sdist') it checks for + password information in the configuration file weewx.conf 2. It merges any existing weewx.conf configuration files into the new, thus preserving any user changes. @@ -43,6 +43,8 @@ from distutils.core import setup, Command from distutils.command.install_data import install_data from distutils.command.sdist import sdist from distutils import log + +import sys import os import os.path import re @@ -159,7 +161,7 @@ def backup(filepath): return newpath class My_sdist(sdist): - """Specialized version of sdist which does not include password information in distribution + """Specialized version of sdist which checks for password information in distribution See http://epydoc.sourceforge.net/stdlib/distutils.command.sdist.sdist-class.html for possible sdist instance methods.""" @@ -173,32 +175,18 @@ class My_sdist(sdist): # If this is the configuration file, then massage it to eliminate # the password info if f == 'weewx.conf': - # Should have a more useful logging message than this! + # If we're working with the configuration file, make sure it doesn't + # have any private data in it. config = configobj.ConfigObj(f) - config.indent_type = ' ' - try: - config['FTP']['user'] = """replace with your username""" - config['FTP']['password'] = """replace with your password""" - config['FTP']['server'] = """replace with your server name, eg, www.threefools.org""" - config['FTP']['path'] = """replace with the destination root directory on your server""" - print config['FTP']['user'] - print config['FTP']['password'] - print config['FTP']['server'] - log.info("%s %s -> %s", 'filtering', f, install_dir) - except KeyError: - pass - try: - config['Wunderground']['station'] = " (replace with your Weather Underground station name)" - config['Wunderground']['password'] = "(replace with your password)" - except KeyError: - pass - if not self.dry_run: - outfile = open(install_dir, 'w') - config.write(outfile) - outfile.close() - return (install_dir, True) - else : - return sdist.copy_file(self, f, install_dir, **kwargs) + + if config.has_key('FTP') and config['FTP'].has_key('password'): + sys.stderr.write("\n*** FTP password found in configuration file. Aborting ***\n\n") + exit() + + if config.has_key('Wunderground') and config['Wunderground'].has_key('password'): + sys.stderr.write("\n*** Wunderground password found in configuration file. Aborting ***\n\n") + exit() + return sdist.copy_file(self, f, install_dir, **kwargs) setup(name='weewx', version=VERSION, diff --git a/weewx.conf b/weewx.conf index c416fe29..94c73f7e 100644 --- a/weewx.conf +++ b/weewx.conf @@ -46,11 +46,6 @@ socket_timeout = 20 rain_year_start = 10 radar_url = http://radar.weather.gov/ridge/lite/N0R/RTX_loop.gif - # Set to 1 (one) to cache LOOP data, otherwise zero. You may - # want to do this if you are using a solid-state disk for your archive, - # as caching the LOOP data will dramatically reduce the number of writes. - cache_loop_data = 0 - # Base temperature for heating days: heating_base = 65 # Base temperature for cooling days: @@ -59,6 +54,10 @@ socket_timeout = 20 # Set to hemisphere abbreviations suitable for your location: hemispheres = N, S, E, W + # Set to 1 (one) to cache LOOP data, otherwise zero. Most people + # will want to set this to one unless you have a specialized application + cache_loop_data = 1 + # Set to type of station (e.g., 'VantagePro' for a Davis VantagePro or VantagePro2) # Must match section name below. station_type = VantagePro @@ -115,38 +114,34 @@ socket_timeout = 20 ############################################################################################ -#[FTP] +[FTP] # # This section is for configuring FTP uploads to a remote web server. # - # Comment the whole section out, including the sub-section header '[FTP]' - # above, if you don't want / need to do this. - # - + # If you wish to do this, make sure the following four lines are uncommented + # and filled out somewhere in this section: # user = replace with your username # password = replace with your password -# server = "replace with your server name, eg, www.threefools.org" -# path = replace with the destination root directory on your server +# server = replace with your server name, e.g, www.threefools.org +# path = replace with the destination root directory on your server (e.g., '/weather) # Set to 1 to use passive mode, zero for active mode: -# passive = 1 + passive = 1 # How many times to try to transfer a file before giving up: -# max_retries = 3 + max_retries = 3 ############################################################################################ -#[Wunderground] +[Wunderground] # # This section is for configuring data transfer to your Weather Underground # station. # - # Comment the whole section out, including the sub-section header - # '[Wunderground]' above, if you don't want / need to do this. - # - + # If you wish to do this, make sure the following two lines are uncommented + # and filled out somewhere in this section. # station = your Weather Underground station ID here (eg, KORHOODR3) # password = your password here