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
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_))