[heycam/webidl] Intent to use a legacy WebIDL construct (#838)

#!/usr/bin/env python3

import json
import os.path
import yaml

# https://stackoverflow.com/a/39681672
class MyDumper(yaml.Dumper):

    def increase_indent(self, flow=False, indentless=False):
        return super(MyDumper, self).increase_indent(flow, False)

# https://foolip.github.io/day-to-day/specs.json
specs = json.load(open('specs.json'))

for spec in specs:
    paths = spec['testpath'].split() if 'testpath' in spec else [spec['id']]
    for path in paths:
        meta_yml = os.path.join(path, 'META.yml')
        if not os.path.exists(meta_yml):
            #print('No {}'.format(meta_yml))
            continue
        with open(meta_yml, 'r') as f:
            meta = yaml.load(f)
        meta['spec'] = spec['href']
        with open(meta_yml, 'w+') as f:
            yaml.dump(meta, stream=f, Dumper=MyDumper, default_flow_style=False)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/838

Received on Wednesday, 29 January 2020 10:15:20 UTC