提交 78c03924 编写于 作者: U unknown

resolved PEP warning in myems-api

上级 f58582db
......@@ -490,4 +490,4 @@ class DistributionSystemClone:
cnx.close()
resp.status = falcon.HTTP_201
resp.location = '/distributionsystems/' + str(new_id)
\ No newline at end of file
resp.location = '/distributionsystems/' + str(new_id)
......@@ -1716,4 +1716,4 @@ class MeterClone:
cnx.close()
resp.status = falcon.HTTP_201
resp.location = '/meters/' + str(new_id)
\ No newline at end of file
resp.location = '/meters/' + str(new_id)
......@@ -145,7 +145,8 @@ class Reporting:
for node in LevelOrderIter(node_dict[space_id]):
space_dict[node.id] = node.name
cursor_system_db.execute(" SELECT ce.id, ce.name AS combined_equipment_name, ce.uuid AS combined_equipment_uuid, s.name AS space_name, "
cursor_system_db.execute(" SELECT ce.id, ce.name AS combined_equipment_name, "
"ce.uuid AS combined_equipment_uuid, s.name AS space_name, "
" cc.name AS cost_center_name, ce.description "
" FROM tbl_spaces s, tbl_spaces_combined_equipments sce, "
" tbl_combined_equipments ce, tbl_cost_centers cc "
......
......@@ -313,10 +313,10 @@ class Reporting:
sensor_dict[row[0]]['point_id_list'] = list()
if sensor_id_list is not None and len(sensor_id_list) > 0:
cursor_system.execute(" SELECT sp.sensor_id, p.id, p.name, p.units "
" FROM tbl_sensors_points sp, tbl_points p "
" WHERE sp.sensor_id in ({}) "
" AND sp.point_id = p.id "
" ORDER BY p.id ".format(','.join("{0}".format(x) for x in sensor_id_list)))
" FROM tbl_sensors_points sp, tbl_points p "
" WHERE sp.sensor_id in ({}) "
" AND sp.point_id = p.id "
" ORDER BY p.id ".format(','.join("{0}".format(x) for x in sensor_id_list)))
rows_sensor_points = cursor_system.fetchall()
if rows_sensor_points is not None and len(rows_sensor_points) > 0:
for row in rows_sensor_points:
......@@ -328,18 +328,20 @@ class Reporting:
for key in sensor_dict:
if sensor_dict[key]['point_id_list'] is not None and len(sensor_dict[key]['point_id_list']) > 0:
cursor_historical.execute(" SELECT point_id, actual_value "
" FROM tbl_analog_value_latest "
" WHERE point_id in ({}) "
" ORDER BY point_id ".format(','.join("{0}".format(x) for x in sensor_dict[key]['point_id_list'])))
" FROM tbl_analog_value_latest "
" WHERE point_id in ({}) "
" ORDER BY point_id ".
format(','.join("{0}".format(x) for x in sensor_dict[key]['point_id_list'])))
rows_analog_values = cursor_historical.fetchall()
if rows_analog_values is not None and len(rows_analog_values) > 0:
for row in rows_analog_values:
point_data_dict[row[0]] = row[1]
cursor_historical.execute(" SELECT point_id, actual_value "
" FROM tbl_digital_value_latest "
" WHERE point_id in ({}) "
" ORDER BY point_id ".format(','.join("{0}".format(x) for x in sensor_dict[key]['point_id_list'])))
" FROM tbl_digital_value_latest "
" WHERE point_id in ({}) "
" ORDER BY point_id ".
format(','.join("{0}".format(x) for x in sensor_dict[key]['point_id_list'])))
rows_digital_values = cursor_historical.fetchall()
if rows_digital_values is not None and len(rows_digital_values) > 0:
for row in rows_digital_values:
......
......@@ -146,7 +146,8 @@ class Reporting:
for node in LevelOrderIter(node_dict[space_id]):
space_dict[node.id] = node.name
cursor_system_db.execute(" SELECT e.id, e.name AS equipment_name, e.uuid AS equipment_uuid, s.name AS space_name, "
cursor_system_db.execute(" SELECT e.id, e.name AS equipment_name, "
"e.uuid AS equipment_uuid, s.name AS space_name, "
" cc.name AS cost_center_name, e.description "
" FROM tbl_spaces s, tbl_spaces_equipments se, "
" tbl_equipments e, tbl_cost_centers cc "
......
......@@ -146,7 +146,8 @@ class Reporting:
for node in LevelOrderIter(node_dict[space_id]):
space_dict[node.id] = node.name
cursor_system_db.execute(" SELECT shopfloor.id, shopfloor.name AS shopfloor_name, shopfloor.uuid AS shopfloor_uuid, s.name AS space_name, "
cursor_system_db.execute(" SELECT shopfloor.id, shopfloor.name AS shopfloor_name, "
"shopfloor.uuid AS shopfloor_uuid, s.name AS space_name, "
" cc.name AS cost_center_name, shopfloor.description "
" FROM tbl_spaces s, tbl_spaces_shopfloors ss,"
" tbl_shopfloors shopfloor, tbl_cost_centers cc "
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册