From edb1efde632b3a2ddcfab41b75d1da61559d098c Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Wed, 9 Oct 2013 22:41:42 +0000 Subject: [PATCH] --bug --- sensorvalues-to-json-zmq.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sensorvalues-to-json-zmq.py b/sensorvalues-to-json-zmq.py index b6cd17c..e2ed5d6 100755 --- a/sensorvalues-to-json-zmq.py +++ b/sensorvalues-to-json-zmq.py @@ -246,23 +246,23 @@ if __name__ == "__main__": try: with open(uwscfg.json_moveto_path,"rb") as fh: - sensor_store = json.loads(fh.read()) + sensor_store_ = json.loads(fh.read()) except Exception, e: logging.debug(e) try: with open(uwscfg.json_backup_path,"rb") as fh: - sensor_store = json.loads(fh.read()) + sensor_store_ = json.loads(fh.read()) except Exception, e: logging.debug(e) - for k in set(sensor_store.keys()).difference(set(uwscfg.zmq_subscribe.split(" "))): - del sensor_store[k] # del old sensordata of sensor we do not subscribe to + for k in set(sensor_store_.keys()).difference(set(uwscfg.zmq_subscribe.split(" "))): + del sensor_store_[k] # del old sensordata of sensor we do not subscribe to - for k in sensor_store.keys(): + for k in sensor_store_.keys(): try: - if len(sensor_store[k][0]) > 1: - sensor_cols_num_[k] = len(sensor_store[k][0]) -1 + if len(sensor_store_[k][0]) > 1: + sensor_cols_num_[k] = len(sensor_store_[k][0]) -1 except: pass @@ -302,7 +302,7 @@ if __name__ == "__main__": cleanTempLastValueOfMovementValues() backup_counter += 1 - # save sensor_store to json for apache + # save sensor_store_ to json for apache with open(uwscfg.json_write_path,"wb") as fh: fh.truncate() fh.write(json.dumps(sensor_store_)) -- 1.7.10.4