개정판 b048d967
issue #000: add find code table item, match exactly same
Change-Id: If36994c70a8624eb34106bd86258b6ba8fb0f09f
DTI_PID/DTI_PID/CodeTables.py | ||
---|---|---|
38 | 38 |
|
39 | 39 |
return None |
40 | 40 |
|
41 |
def find_match_exactly(self, text): |
|
42 |
for value in self.values: |
|
43 |
if text == value[1]: |
|
44 |
return value[1] |
|
45 |
else: |
|
46 |
matches = [x for x in value[3] if x and text == x] |
|
47 |
if matches: return value[1] |
|
48 |
|
|
41 | 49 |
@staticmethod |
42 | 50 |
def instance(table_name): |
43 | 51 |
""" return instance has given table name """ |
DTI_PID/DTI_PID/TextItemFactory.py | ||
---|---|---|
314 | 314 |
def isTagNoText(self, text): |
315 | 315 |
from CodeTables import CodeTable |
316 | 316 |
|
317 |
found = CodeTable.instance('EqpTagNames').find_starts_with(text)
|
|
317 |
found = CodeTable.instance('EqpTagNames').find_match_exactly(text)
|
|
318 | 318 |
|
319 | 319 |
return True if found else False |
320 | 320 |
|
... | ... | |
324 | 324 |
""" |
325 | 325 |
from CodeTables import CodeTable |
326 | 326 |
|
327 |
found = CodeTable.instance('ValveOperCodes').find_starts_with(text)
|
|
327 |
found = CodeTable.instance('ValveOperCodes').find_match_exactly(text)
|
|
328 | 328 |
|
329 | 329 |
return True if found else False |
330 | 330 |
|
... | ... | |
332 | 332 |
""" check if given text is reserved words """ |
333 | 333 |
from CodeTables import CodeTable |
334 | 334 |
|
335 |
found = CodeTable.instance('ReservedWords').find_starts_with(text)
|
|
335 |
found = CodeTable.instance('ReservedWords').find_match_exactly(text)
|
|
336 | 336 |
|
337 | 337 |
return True if found else False |
내보내기 Unified diff