diff --git a/examples/fileparse/bin/user/fileparse.py b/examples/fileparse/bin/user/fileparse.py index e6005c5f..6372aae0 100644 --- a/examples/fileparse/bin/user/fileparse.py +++ b/examples/fileparse/bin/user/fileparse.py @@ -54,7 +54,7 @@ import weewx.drivers from weeutil.log import logdbg, loginf, logerr DRIVER_NAME = 'FileParse' -DRIVER_VERSION = "0.6" +DRIVER_VERSION = "0.7" def _get_as_float(d, s): @@ -80,9 +80,9 @@ class FileParseDriver(weewx.drivers.AbstractDevice): # mapping from variable names to weewx names self.label_map = stn_dict.get('label_map', {}) - loginf("data file is %s" % self.path) - loginf("polling interval is %s" % self.poll_interval) - loginf('label map is %s' % self.label_map) + loginf("Data file is %s" % self.path) + loginf("Polling interval is %s" % self.poll_interval) + loginf('Label map is %s' % self.label_map) def genLoopPackets(self): while True: @@ -117,4 +117,4 @@ if __name__ == "__main__": import weeutil.weeutil driver = FileParseDriver() for packet in driver.genLoopPackets(): - print weeutil.weeutil.timestamp_to_string(packet['dateTime']), packet + print(weeutil.weeutil.timestamp_to_string(packet['dateTime']), packet) diff --git a/examples/fileparse/changelog b/examples/fileparse/changelog index 36189c83..353c700c 100644 --- a/examples/fileparse/changelog +++ b/examples/fileparse/changelog @@ -1,3 +1,6 @@ +0.7 03jul2019 +* Port to Python 3 + 0.6 17apr2016 * keep pylint happy * provide more configuration instructions in comments diff --git a/examples/fileparse/readme.txt b/examples/fileparse/readme.txt index 42e51747..fc0ab0a0 100644 --- a/examples/fileparse/readme.txt +++ b/examples/fileparse/readme.txt @@ -35,14 +35,28 @@ cp /home/weewx/examples/fileparse/bin/fileparse.py /home/weewx/bin/user path = /var/tmp/datafile driver = user.fileparse -3) in the WeeWX configuration file, modify the station_type setting to use the +3) If the variables in the file have names different from those in the database +schema, then add a mapping section called label_map. This will map the +variables in the file to variables in the database columns. For example: + +[FileParse] + + ... (as before) + + [[label_map]] + temp = outTemp + humi = outHumidity + in_temp = inTemp + in_humid = inHumidity + +4) in the WeeWX configuration file, modify the station_type setting to use the fileparse driver [Station] ... station_type = FileParse -4) restart WeeWX +5) restart WeeWX sudo /etc/init.d/weewx stop sudo /etc/init.d/weewx start