Skip to content

Commit b5d2dbe

Browse files
authored
emit tool info in comment
1 parent a1fd632 commit b5d2dbe

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

__main__.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,8 @@ def main(pack_path: str, xml_path: str):
9696

9797
print('Vendor \'{}\' existed devices: {}'.format(vendor_name, str(vendor_existed_devs)))
9898

99-
# add comment header
100-
xml_dom_db.append(ElementTree.Comment(''))
101-
xml_dom_db.append(ElementTree.Comment(' {} ({}) '.format(vendor_name, dev_familys[0])))
102-
xml_dom_db.append(ElementTree.Comment(''))
103-
10499
ign_cnt = 0
100+
has_comment_header = False
105101

106102
for dev in cmsis_pack.devices:
107103
print('---')
@@ -118,6 +114,13 @@ def main(pack_path: str, xml_path: str):
118114
print('skip duplicate device: ' + dev.part_number)
119115
continue
120116

117+
# add comment header
118+
if not has_comment_header:
119+
has_comment_header = True
120+
xml_dom_db.append(ElementTree.Comment(''))
121+
xml_dom_db.append(ElementTree.Comment(' {} ({}) (add by \'jlink-dev-addon\', author: github0null) '.format(vendor_name, dev_familys[0])))
122+
xml_dom_db.append(ElementTree.Comment(''))
123+
121124
n_ele = SubElement(xml_dom_db, 'Device')
122125

123126
n_ele_cp = SubElement(n_ele, 'ChipInfo')

0 commit comments

Comments
 (0)