Shortened readcsvfile.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 4 Sep 2018 17:53:49 +0000 (19:53 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 4 Sep 2018 18:12:32 +0000 (20:12 +0200)
seewasser.py

index f2ab4a7..811ebbe 100755 (executable)
@@ -64,9 +64,7 @@ def writesensordatacsv(config, sensor_id, sensor_name, timestamp, value_type, va
 
 def readcsvfile(csvfile):
     with open(csvfile, "r", newline="") as file:
-        reader = csv.DictReader(file, dialect = "excel", fieldnames=("timestamp", "sensor_id", "sensor_name", "value"))
-        for row in reader:
-            yield row
+        yield from csv.DictReader(file, dialect = "excel", fieldnames=("timestamp", "sensor_id", "sensor_name", "value"))
 
 
 def writesensordatadb(config, sensor_id, sensor_name, timestamp, value_type, value_raw, value):