diff options
author | Sunil Shetye | 2025-01-20 11:19:15 +0530 |
---|---|---|
committer | Sunil Shetye | 2025-01-20 11:19:15 +0530 |
commit | 818a9e91957f6be16dac93b07ae9f493024138c1 (patch) | |
tree | 29183d908ce4984f2386135b799fee1f87dd61f0 | |
parent | 60a5c74cc772f473e3063b9a567668d86c0b5d55 (diff) | |
download | Common-Interface-Project-818a9e91957f6be16dac93b07ae9f493024138c1.tar.gz Common-Interface-Project-818a9e91957f6be16dac93b07ae9f493024138c1.tar.bz2 Common-Interface-Project-818a9e91957f6be16dac93b07ae9f493024138c1.zip |
simplify logic for initial tags
-rwxr-xr-x | blocks/Xcos/MxGraphParser.py | 1 | ||||
-rwxr-xr-x | blocks/Xcos/XmlParser.py | 13 |
2 files changed, 4 insertions, 10 deletions
diff --git a/blocks/Xcos/MxGraphParser.py b/blocks/Xcos/MxGraphParser.py index ced75756..bf4f7d1c 100755 --- a/blocks/Xcos/MxGraphParser.py +++ b/blocks/Xcos/MxGraphParser.py @@ -49,6 +49,7 @@ outmodel.set('as', 'model') def remove_hyphen_number(s): return re.sub(r'-\d+$', '', s) + def check_point_on_array(array, point, left_right_direction=True): if array is None: return False, array, [] diff --git a/blocks/Xcos/XmlParser.py b/blocks/Xcos/XmlParser.py index ce707dcf..37d438a7 100755 --- a/blocks/Xcos/XmlParser.py +++ b/blocks/Xcos/XmlParser.py @@ -517,8 +517,8 @@ for root in model: cellslength = len(cells) oldcellslength = 0 blkgeometry = {} - rootattribid = None - parentattribid = None + rootattribid = '0:1:0' + parentattribid = '0:2:0' key1 = {} graph_link = {} removable_link = {} @@ -529,14 +529,7 @@ for root in model: while cellslength > 0 and cellslength != oldcellslength: for i, cell in enumerate(cells): try: - if i == 0 and oldcellslength == 0: - attribid = '0:1:0' - rootattribid = attribid - continue - - if i == 1 and oldcellslength == 0: - attribid = '0:2:0' - parentattribid = attribid + if i <= 1 and oldcellslength == 0: continue attrib = cell.attrib |