- From: Lizz <notifications@github.com>
- Date: Wed, 29 Jan 2020 02:15:16 -0800
- To: heycam/webidl <webidl@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 29 January 2020 10:15:20 UTC
#!/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