Skip to content

Commit

Permalink
Implement atomic write for gauge-data.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
gjr80 committed Apr 26, 2018
1 parent a011849 commit 330a5fc
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 19 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The *Realtime gauge-data* extension can be installed manually or automatically u
1. Download the latest *Realtime gauge-data* extension from the *Realtime gauge-data* extension [releases page](https://github.com/gjr80/weewx-realtime_gauge-data/releases) into a directory accessible from the weeWX machine.


wget -P $DOWNLOAD_ROOT https://github.com/gjr80/weewx-realtime_gauge-data/releases/download/v0.3.2/rtgd-0.3.2.tar.gz
wget -P $DOWNLOAD_ROOT https://github.com/gjr80/weewx-realtime_gauge-data/releases/download/v0.3.3/rtgd-0.3.3.tar.gz

where $DOWNLOAD_ROOT is the path to the directory where the *Realtime gauge-data* extension is to be downloaded.

Expand All @@ -49,15 +49,15 @@ The *Realtime gauge-data* extension can be installed manually or automatically u

3. Install the *Realtime gauge-data* extension downloaded at step 1 using the *wee_extension* utility:

wee_extension --install=$DOWNLOAD_ROOT/rtgd-0.3.2.tar.gz
wee_extension --install=$DOWNLOAD_ROOT/rtgd-0.3.3.tar.gz

This will result in output similar to the following:

Request to install '/var/tmp/rtgd-0.3.2.tar.gz'
Extracting from tar archive /var/tmp/rtgd-0.3.2.tar.gz
Request to install '/var/tmp/rtgd-0.3.3.tar.gz'
Extracting from tar archive /var/tmp/rtgd-0.3.3.tar.gz
Saving installer file to /home/weewx/bin/user/installer/Rtgd
Saved configuration dictionary. Backup copy at /home/weewx/weewx.conf.20170215124410
Finished installing extension '/var/tmp/rtgd-0.3.2.tar.gz'
Finished installing extension '/var/tmp/rtgd-0.3.3.tar.gz'

4. Start weeWX:

Expand All @@ -73,13 +73,13 @@ This will result in the *gauge-data.txt* file being generated on receipt of each

1. Download the latest *Realtime gauge-data* extension from the Realtime gauge-data [releases page](https://github.com/gjr80/weewx-realtime_gauge-data/releases) into a directory accessible from the weeWX machine.

wget -P $DOWNLOAD_ROOT https://github.com/gjr80/weewx-realtime_gauge-data/releases/download/v0.3.2/rtgd-0.3.2.tar.gz
wget -P $DOWNLOAD_ROOT https://github.com/gjr80/weewx-realtime_gauge-data/releases/download/v0.3.3/rtgd-0.3.3.tar.gz

where $DOWNLOAD_ROOT is the path to the directory where the *Realtime gauge-data* extension is to be downloaded.

2. Unpack the extension as follows:

tar xvfz rtgd-0.3.2.tar.gz
tar xvfz rtgd-0.3.3.tar.gz

3. Copy files from within the resulting directory as follows:

Expand Down
6 changes: 3 additions & 3 deletions bin/user/rtgd.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see http://www.gnu.org/licenses/.
#
# Version: 0.3.3 Date: ?? January 2018
# Version: 0.3.3 Date: 26 April 2018
#
# Revision History
# ?? January 2018 v0.3.3
# 26 April 2018 v0.3.3
# - implemented atomic write when writing gauge-data.txt to file
# 20 January 2018 v0.3.2
# - modified rtgdthread queue management to fix 100% CPU usage issue
Expand Down Expand Up @@ -409,7 +409,7 @@
from weeutil.weeutil import to_bool, to_int, startOfDay

# version number of this script
RTGD_VERSION = '0.3.0'
RTGD_VERSION = '0.3.3'
# version number (format) of the generated gauge-data.txt
GAUGE_DATA_VERSION = '13'

Expand Down
2 changes: 2 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
v0.3.3
* implemented atomic write when writing gauge-data.txt to file
v0.3.2
* modified rtdgthread queue management to fix 100% CPU usage issue
v0.3.1
Expand Down
6 changes: 4 additions & 2 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
#
# Installer for Realtime gauge-data
#
# Version: 0.3.2 Date: 20 January 2018
# Version: 0.3.3 Date: 26 April 2018
#
# Revision History
# 26 April 2018 v0.3.3
# - bumped version only
# 20 January 2018 v0.3.2
# - bumped version only
# 3 December 2017 v0.3.1
Expand Down Expand Up @@ -61,7 +63,7 @@
from setup import ExtensionInstaller

REQUIRED_VERSION = "3.4.0"
RTGD_VERSION = "0.3.2"
RTGD_VERSION = "0.3.3"


def loader():
Expand Down
14 changes: 7 additions & 7 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ gauge-data releases page (https://github.com/gjr80/weewx-realtime_gauge-data
a directory accessible from the weeWX machine.

wget -P $DOWNLOAD_ROOT https://github.com/gjr80/weewx-realtime_gauge-data
/releases/download/v0.3.2/rtgd-0.3.2.tar.gz
/releases/download/v0.3.3/rtgd-0.3.3.tar.gz

where $DOWNLOAD_ROOT is the path to the directory where the Realtime
gauge-data extension is to be downloaded.
Expand All @@ -59,15 +59,15 @@ a directory accessible from the weeWX machine.
3. Install the Realtime gauge-data extension downloaded at step 1 using the
wee_extension utility:

wee_extension --install=$DOWNLOAD_ROOT/rtgd-0.3.2.tar.gz
wee_extension --install=$DOWNLOAD_ROOT/rtgd-0.3.3.tar.gz

This will result in output similar to the following:

Request to install '/var/tmp/rtgd-0.3.2.tar.gz'
Extracting from tar archive /var/tmp/rtgd-0.3.2.tar.gz
Request to install '/var/tmp/rtgd-0.3.3.tar.gz'
Extracting from tar archive /var/tmp/rtgd-0.3.3.tar.gz
Saving installer file to /home/weewx/bin/user/installer/Rtgd
Saved configuration dictionary. Backup copy at /home/weewx/weewx.conf.20161123124410
Finished installing extension '/var/tmp/rtgd-0.3.2.tar.gz'
Finished installing extension '/var/tmp/rtgd-0.3.3.tar.gz'

4. Start weeWX:

Expand All @@ -91,14 +91,14 @@ gauge-data releases page (https://github.com/gjr80/weewx-realtime_gauge-data
a directory accessible from the weeWX machine.

wget -P $DOWNLOAD_ROOT https://github.com/gjr80/weewx-realtime_gauge-data
/releases/download/v0.3.2/rtgd-0.3.2.tar.gz
/releases/download/v0.3.3/rtgd-0.3.3.tar.gz

where $DOWNLOAD_ROOT is the path to the directory where the Realtime
gauge-data extension is to be downloaded.

2. Unpack the extension as follows:

tar xvfz rtgd-0.3.2.tar.gz
tar xvfz rtgd-0.3.3.tar.gz

3. Copy files from within the resulting folder as follows:

Expand Down

0 comments on commit 330a5fc

Please sign in to comment.