From 9cd087dcb78a942cb320927f2971f4074fb2be83 Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Thu, 11 Jan 2018 20:58:53 +0000 Subject: [PATCH] Allow input from both yaml and json. --- tools/sjson.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/sjson.py b/tools/sjson.py index 4e3483b2..8f32d36d 100755 --- a/tools/sjson.py +++ b/tools/sjson.py @@ -48,7 +48,10 @@ if ops.inout: g_data={} if ops._in: - g_data = json.load(open(ops._in)) + try: + g_data = yaml.load(open(ops._in)) + except: + g_data = json.load(open(ops._in)) if ops.kj: (k, j) = ops.kj