Devin Jeanpierre | 19fc55f | 2017-04-24 10:49:00 -0700 | [diff] [blame] | 1 | # Copyright 2007 The JsonCpp Authors |
Sam Clegg | 6386061 | 2015-04-09 18:01:33 -0700 | [diff] [blame] | 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 | |
Christopher Dunn | bd1e895 | 2014-11-19 23:30:47 -0600 | [diff] [blame] | 6 | from __future__ import print_function |
Christopher Dunn | f986423 | 2007-06-14 21:01:26 +0000 | [diff] [blame] | 7 | import glob |
| 8 | import os.path |
Christopher Dunn | 494950a | 2015-01-24 15:29:52 -0600 | [diff] [blame] | 9 | for path in glob.glob('*.json'): |
Christopher Dunn | f986423 | 2007-06-14 21:01:26 +0000 | [diff] [blame] | 10 | text = file(path,'rt').read() |
| 11 | target = os.path.splitext(path)[0] + '.expected' |
Christopher Dunn | 494950a | 2015-01-24 15:29:52 -0600 | [diff] [blame] | 12 | if os.path.exists(target): |
Christopher Dunn | bd1e895 | 2014-11-19 23:30:47 -0600 | [diff] [blame] | 13 | print('skipping:', target) |
Christopher Dunn | f986423 | 2007-06-14 21:01:26 +0000 | [diff] [blame] | 14 | else: |
Christopher Dunn | bd1e895 | 2014-11-19 23:30:47 -0600 | [diff] [blame] | 15 | print('creating:', target) |
Christopher Dunn | f986423 | 2007-06-14 21:01:26 +0000 | [diff] [blame] | 16 | file(target,'wt').write(text) |
| 17 | |