--bug
authorBernhard Tittelbach <xro@realraum.at>
Wed, 9 Oct 2013 22:41:42 +0000 (22:41 +0000)
committerBernhard Tittelbach <xro@realraum.at>
Wed, 9 Oct 2013 22:41:42 +0000 (22:41 +0000)
sensorvalues-to-json-zmq.py

index b6cd17c..e2ed5d6 100755 (executable)
@@ -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_))