개정판 39d5c40a
build issue #701: fix xml load
DTI_PID/DTI_PID/Shapes/EngineeringUnknownItem.py | ||
---|---|---|
189 | 189 |
points = [[int(float(coord)) for coord in pt.split(',')] for pt in node.find('POINTS').text.split('\n')] |
190 | 190 |
|
191 | 191 |
line_indicator_node = node.find('LINEINDICATOR') |
192 |
if line_indicator_node: |
|
192 |
if line_indicator_node is not None:
|
|
193 | 193 |
lineIndicator = line_indicator_node.text.split('#') |
194 | 194 |
if lineIndicator[0] == 'True': |
195 | 195 |
item = QEngineeringUnknownItem(points, 'True', lineIndicator[1], [int(lineIndicator[2]), int(lineIndicator[3]), int(lineIndicator[4]), int(lineIndicator[5])]) |
... | ... | |
197 | 197 |
item = QEngineeringUnknownItem(points, 'Match', lineIndicator[1], [int(lineIndicator[2]), int(lineIndicator[3]), int(lineIndicator[4]), int(lineIndicator[5])]) |
198 | 198 |
else: |
199 | 199 |
item = QEngineeringUnknownItem(points, 'False') |
200 |
else: |
|
201 |
item = QEngineeringUnknownItem(points, 'False') |
|
200 | 202 |
|
201 | 203 |
if node.find('AREA') is None: |
202 | 204 |
appDocData = AppDocData.instance() |
... | ... | |
212 | 214 |
else: |
213 | 215 |
item.area = node.find('AREA').text |
214 | 216 |
except Exception as ex: |
217 |
from App import App |
|
215 | 218 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
216 | 219 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
217 | 220 |
|
내보내기 Unified diff