개정판 ea63e205
add size compare with table
Change-Id: Iefb72b695ac6a2e3a14b1849bb1af87d3ee05116
DTI_PID/DTI_PID/TextItemFactory.py | ||
---|---|---|
389 | 389 |
tokens = [first, second] if second is not None and len(second) is not 0 else [first] |
390 | 390 |
index = 0 |
391 | 391 |
for token in tokens: |
392 |
matches = [(sizeData.find(token, sizeUnit) if sizeUnit else sizeData.find(token)) for sizeData in pipe_sizes
|
|
392 |
matches = [[(sizeData.find(token, sizeUnit) if sizeUnit else sizeData.find(token)), sizeData] for sizeData in pipe_sizes
|
|
393 | 393 |
if (sizeData.find(token, sizeUnit) if sizeUnit else sizeData.find(token))] |
394 | 394 |
if matches: |
395 | 395 |
tokens[index] = matches[0] |
... | ... | |
397 | 397 |
return False |
398 | 398 |
index += 1 |
399 | 399 |
|
400 |
if len(tokens) == 2: |
|
401 |
if self.inch_to_number(tokens[0]) < self.inch_to_number(tokens[1]):
|
|
400 |
if len(tokens) == 2 and tokens[0][1].inch and tokens[1][1].inch:
|
|
401 |
if tokens[0][1].inch < tokens[1][1].inch:
|
|
402 | 402 |
tokens[0], tokens[1] = tokens[1], tokens[0] |
403 |
return [delimiter.join(tokens), tokens, delimiter] |
|
403 |
elif len(tokens) == 2: |
|
404 |
if self.inch_to_number(tokens[0][0]) < self.inch_to_number(tokens[1][0]): |
|
405 |
tokens[0], tokens[1] = tokens[1], tokens[0] |
|
406 |
|
|
407 |
return [delimiter.join([token[0] for token in tokens]), [token[0] for token in tokens], delimiter] |
|
404 | 408 |
except Exception as ex: |
405 | 409 |
from App import App |
406 | 410 |
message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, |
내보내기 Unified diff