Jelajahi Sumber

mxg:change import ignore dir package

mengxiangge 5 tahun lalu
induk
melakukan
6474575fbf

+ 15 - 12
src/system_relation/systemdatautils.py

@@ -2,7 +2,7 @@
 
 """
 import test
-from src.system_relation import systemutils, graph_model
+import systemutils, graph_model
 
 
 def get_dicdata(sql,dic):
@@ -219,17 +219,20 @@ def save_edge_data(edge,block_id):
 	:param block_id:
 	:return:
 	"""
-	vertex1=edge.start_vertex
-	vertex2=edge.end_vertex
-	c1=vertex1.system_data
-	c2=vertex2.system_data
-	model1= systemutils.get_specify_type_parent(vertex1, graph_model.FloorGraph).model
-	model2 = systemutils.get_specify_type_parent(vertex2, graph_model.FloorGraph).model
-	sql="insert into revit_calc.connected_block" \
-		"(id1,type1,model_id1,id2,type2,model_id2,block_id,project_id) values " \
-		"('%s','%s','%s','%s','%s','%s','%s','%s')"\
-		%(c1.id,c1.type,model1.file_id,c2.id,c2.type,model2.file_id,block_id,model1.project_id)
-	data = test.save_data(sql)
+	try:
+		vertex1=edge.start_vertex
+		vertex2=edge.end_vertex
+		c1=vertex1.system_data
+		c2=vertex2.system_data
+		model1= systemutils.get_specify_type_parent(vertex1, graph_model.FloorGraph).model
+		model2 = systemutils.get_specify_type_parent(vertex2, graph_model.FloorGraph).model
+		sql="insert into revit_calc.connected_block" \
+			"(id1,type1,model_id1,id2,type2,model_id2,block_id,project_id) values " \
+			"('%s','%s','%s','%s','%s','%s','%s','%s')"\
+			%(c1.id,c1.type,model1.file_id,c2.id,c2.type,model2.file_id,block_id,model1.project_id)
+		data = test.save_data(sql)
+	except Exception as e:
+		print(e)
 def del_project_data(project_id):
 	"""
 	Before save.delete old data.

+ 2 - 1
src/system_relation/test_systemblock.py

@@ -1,4 +1,5 @@
-from src.system_relation import systemutils, graph_model, systemdatautils
+import systemutils, graph_model, systemdatautils
+
 
 if '__main__'==__name__:
 	project_id="Pj1101010015"