From cd4fd5d237c6decac7f7b4b2442654c276f53035 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 12 Mar 2021 08:18:19 +0200 Subject: refactor(prettyson): reformat, port to Pytthon 3 --- prettyson | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/prettyson b/prettyson index 0a327ad..e2cb0df 100755 --- a/prettyson +++ b/prettyson @@ -1,6 +1,8 @@ -#!/usr/bin/python +#!/usr/bin/python3 + +import json +import sys -import sys, json def inputs(args): if args: @@ -8,10 +10,11 @@ def inputs(args): with open(filename) as f: yield filename, f else: - yield '-', sys.stdin + yield "-", sys.stdin + objs = [] for filename, f in inputs(sys.argv[1:]): objs.append(json.load(f)) json.dump(objs, sys.stdout, indent=4) -sys.stdout.write('\n') +sys.stdout.write("\n") -- cgit v1.2.1