generate_expected.py 576 B

123456789101112131415161718
  1. # Copyright 2007 Baptiste Lepilleur and The JsonCpp Authors
  2. # Distributed under MIT license, or public domain if desired and
  3. # recognized in your jurisdiction.
  4. # See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
  5. from __future__ import print_function
  6. import glob
  7. import os.path
  8. for path in glob.glob('*.json'):
  9. text = file(path,'rt').read()
  10. target = os.path.splitext(path)[0] + '.expected'
  11. if os.path.exists(target):
  12. print('skipping:', target)
  13. else:
  14. print('creating:', target)
  15. file(target,'wt').write(text)