Changing yaml output to show hex numbers as hex and not as decimal

This commit is contained in:
codemann8
2023-08-02 15:01:37 -05:00
parent 35f3abc1c1
commit 1566813f81
2 changed files with 10 additions and 1 deletions

View File

@@ -737,6 +737,13 @@ class bidict(dict):
super(bidict, self).__delitem__(key)
class HexInt(int): pass
def hex_representer(dumper, data):
import yaml
return yaml.ScalarNode('tag:yaml.org,2002:int', f"{data:#0{4}x}")
if __name__ == '__main__':
# make_new_base2current()
# read_entrance_data(old_rom=sys.argv[1])