(text, tag)
| 19 | from lib.core.settings import PAYLOAD_XML_FILES |
| 20 | |
| 21 | def cleanupVals(text, tag): |
| 22 | if tag == "clause" and '-' in text: |
| 23 | text = re.sub(r"(\d+)-(\d+)", lambda match: ','.join(str(_) for _ in xrange(int(match.group(1)), int(match.group(2)) + 1)), text) |
| 24 | |
| 25 | if tag in ("clause", "where"): |
| 26 | text = text.split(',') |
| 27 | |
| 28 | if hasattr(text, "isdigit") and text.isdigit(): |
| 29 | text = int(text) |
| 30 | |
| 31 | elif isinstance(text, list): |
| 32 | count = 0 |
| 33 | |
| 34 | for _ in text: |
| 35 | text[count] = int(_) if _.isdigit() else _ |
| 36 | count += 1 |
| 37 | |
| 38 | if len(text) == 1 and tag not in ("clause", "where"): |
| 39 | text = text[0] |
| 40 | |
| 41 | return text |
| 42 | |
| 43 | def parseXmlNode(node): |
| 44 | for element in node.findall("boundary"): |
no test coverage detected
searching dependent graphs…