diff options
-rw-r--r-- | NEWS | 5 | ||||
-rwxr-xr-x | prettyml | 11 | ||||
-rwxr-xr-x | prettyson | 9 |
3 files changed, 23 insertions, 2 deletions
@@ -6,10 +6,11 @@ package, please yell at me, and I'll start doing that, but for now, I'll assume I'm the only user. -Version UNRELEASED ------------------- +Version 1.20121007+git, not yet released +---------------------------------------- * `do-until` now displays a try counter when the command fails. +* Added `prettyson` and `prettyml` scripts. Version 1.20121007 ------------------ diff --git a/prettyml b/prettyml new file mode 100755 index 0000000..fe9f468 --- /dev/null +++ b/prettyml @@ -0,0 +1,11 @@ +#!/usr/bin/python + +import sys + +import yaml + +objs = [] +for filename in sys.argv[1:]: + with open(filename) as f: + objs.append(yaml.safe_load(f)) +yaml.safe_dump_all(objs, stream=sys.stdout, indent=4, default_flow_style=False) diff --git a/prettyson b/prettyson new file mode 100755 index 0000000..367cff8 --- /dev/null +++ b/prettyson @@ -0,0 +1,9 @@ +#!/usr/bin/python + +import sys, json + +objs = [] +for filename in sys.argv[1:]: + with open(filename) as f: + objs.append(json.load(f)) +json.dump(objs, sys.stdout, indent=4) |