Ole Troan | 5c318c7 | 2020-05-05 12:23:47 +0200 | [diff] [blame] | 1 | # CRC generation |
2 | import json | ||||
3 | |||||
4 | # | ||||
5 | # Plugin entry point | ||||
6 | # | ||||
7 | def run(args, input_filename, s): | ||||
8 | j = {} | ||||
9 | major = 0 | ||||
10 | if 'version' in s['Option']: | ||||
11 | v = s['Option']['version'] | ||||
12 | (major, minor, patch) = v.split('.') | ||||
13 | for t in s['Define']: | ||||
14 | j[t.name] = {'crc': f'{t.crc:#08x}', 'version': major, | ||||
15 | 'options': t.options} | ||||
16 | return json.dumps(j, indent=4, separators=(',', ': ')) |