diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-03-12 08:18:19 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-03-12 08:24:06 +0200 |
commit | cd4fd5d237c6decac7f7b4b2442654c276f53035 (patch) | |
tree | d42293dd58449cc093d478c32f9215bfc332ec2d | |
parent | cedecd2ec55a8317873d96ba69b4e9f6126b75c5 (diff) | |
download | extrautils-cd4fd5d237c6decac7f7b4b2442654c276f53035.tar.gz |
refactor(prettyson): reformat, port to Pytthon 3
-rwxr-xr-x | prettyson | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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") |