mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
Adding tu name comment in a 3.8 friendly way
This commit is contained in:
+6
-1
@@ -231,6 +231,7 @@ def update_asset_slice_config(tu_name: str, binary_slice_file_path: str, asset_s
|
||||
|
||||
binary_commented_map = data[binary_commented_map_key]
|
||||
|
||||
insert_tu_name_comment = True
|
||||
for section in symbols_for_tu[".data"].sections:
|
||||
for asset_symbol in section.symbols:
|
||||
print("Add entry for: " + asset_symbol.symbol_name + "? (y/n)")
|
||||
@@ -244,10 +245,14 @@ def update_asset_slice_config(tu_name: str, binary_slice_file_path: str, asset_s
|
||||
asset_commented_map : CommentedMap = None
|
||||
if binary_commented_map.__contains__(asset_symbol.symbol_name):
|
||||
asset_commented_map = binary_commented_map[asset_symbol.symbol_name]
|
||||
insert_tu_name_comment = False
|
||||
else:
|
||||
asset_commented_map = CommentedMap()
|
||||
binary_commented_map.insert(len(binary_commented_map), asset_symbol.symbol_name, asset_commented_map)
|
||||
binary_commented_map.ca.items[asset_symbol.symbol_name] = [None, asset_symbol.symbol_name, None, None]
|
||||
|
||||
if insert_tu_name_comment:
|
||||
insert_tu_name_comment = False
|
||||
binary_commented_map.yaml_set_comment_before_after_key(key=asset_symbol.symbol_name, indent=2, before=tu_name)
|
||||
|
||||
# Add in the address range
|
||||
address_commented_seq: CommentedSeq = None
|
||||
|
||||
Reference in New Issue
Block a user