File: generate_expected.py

package info (click to toggle)
libjsoncpp 0.6.0~rc2-3.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,268 kB
  • ctags: 944
  • sloc: cpp: 5,227; python: 1,259; ansic: 82; makefile: 32
file content (11 lines) | stat: -rw-r--r-- 299 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
import glob
import os.path
for path in glob.glob( '*.json' ):
    text = file(path,'rt').read()
    target = os.path.splitext(path)[0] + '.expected'
    if os.path.exists( target ):
        print 'skipping:', target
    else:
        print 'creating:', target
        file(target,'wt').write(text)