summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-03-12 08:17:32 +0200
committerLars Wirzenius <liw@liw.fi>2021-03-12 08:24:06 +0200
commitcedecd2ec55a8317873d96ba69b4e9f6126b75c5 (patch)
tree38d6aa1e310668501f2a064daa67ef6b4d28369f
parent961ebbca7c915f3aa6924a9ed053fedd529cd397 (diff)
downloadextrautils-cedecd2ec55a8317873d96ba69b4e9f6126b75c5.tar.gz
reformat: prettyml
-rwxr-xr-xprettyml9
1 files changed, 5 insertions, 4 deletions
diff --git a/prettyml b/prettyml
index e15b3b2..d6932be 100755
--- a/prettyml
+++ b/prettyml
@@ -4,20 +4,21 @@ import sys
import yaml
+
def inputs(args):
if args:
for filename in args:
with open(filename) as f:
yield filename, f
else:
- yield '-', sys.stdin
+ yield "-", sys.stdin
def string_representer(dumper, data):
style = None
- if '\n' in data:
- style = '|'
- return dumper.represent_scalar('tag:yaml.org,2002:str', data, style=style)
+ if "\n" in data:
+ style = "|"
+ return dumper.represent_scalar("tag:yaml.org,2002:str", data, style=style)
yaml.add_representer(str, string_representer, Dumper=yaml.SafeDumper)