From ac778bc81dcb7dd678a2ab416004e596cabb7fb2 Mon Sep 17 00:00:00 2001 From: Tom Keffer Date: Mon, 21 Dec 2009 15:03:44 +0000 Subject: [PATCH] Merge w/main trunk. setup now deletes the old readme.htm file. --- CHANGES.txt | 3 +++ TODO.txt | 2 -- setup.py | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index c1cb9ef2..a05b21e6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -17,6 +17,9 @@ outside temperature drop below 40 degrees. Moved the compass rose used in progressive vector plots into the interior of the plot. + +Install now deletes public_html/#upstream.last, thus forcing all files to +be uploaded to the web server at the next opportunity. 1.2.0 11/22/09 diff --git a/TODO.txt b/TODO.txt index a3ae1618..886162b7 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,7 +1,5 @@ TODO before the next release: -Test setup.py to make sure it deletes #upstream.last - Add year-to-date rain feature. Check example in weewxd.py of how to override the default engine diff --git a/setup.py b/setup.py index 8499542b..0da95562 100755 --- a/setup.py +++ b/setup.py @@ -81,12 +81,29 @@ class My_install_data(install_data): return rv def run(self): + # Back up the old template directory if it exists template_dir = os.path.join(self.install_dir, 'templates') if os.path.exists(template_dir): backupdir = backup(template_dir) print "Backed up template subdirectory to %s" % backupdir + + # Run the superclass's run(): install_data.run(self) + # If the file #upstream.last exists, delete it, thus forcing + # all files to be FTP'd to the server at the next opportunity. + try: + os.remove(os.path.join(self.install_dir, 'public_html/#upstream.last')) + except: + pass + + # If the file $WEEWX_ROOT/readme.htm exists, delete it. It's + # the old readme (since replaced with docs/readme.htm) + try: + os.remove('readme.htm') + except: + pass + def massageConfigFile(self, f, install_dir, **kwargs): """Merges any old config file into the new one, and sets WEEWX_ROOT