File: gen-multi.py

package info (click to toggle)
python-tomlkit 0.13.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,096 kB
  • sloc: python: 5,985; makefile: 20; sh: 5
file content (14 lines) | stat: -rwxr-xr-x 390 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python3

import glob
import os.path

for f in glob.glob('tests/invalid/*/*.multi'):
    base = os.path.dirname(f[:-6])
    for l in open(f, 'rb').readlines():
        name = l.split(b'=')[0].strip().decode()
        if name == '' or name[0] == '#':
            continue
        path = base + "/" + name + '.toml'
        with open(path, 'wb+') as fp:
            fp.write(l)