summaryrefslogtreecommitdiff
path: root/dump-bag
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2016-03-13 14:23:38 +0200
committerLars Wirzenius <liw@liw.fi>2016-03-13 15:50:51 +0200
commitf4e308bd1882875bcdd6e347e27f6795233b8af6 (patch)
tree2c3c7dc2331c3b070b318c4b9319f0f01941f603 /dump-bag
parent553bc915c294f40b25f64c26b3fe88b80e0a740e (diff)
downloadobnam-f4e308bd1882875bcdd6e347e27f6795233b8af6.tar.gz
Make dump-bag to use YAML markers between objs
Diffstat (limited to 'dump-bag')
-rwxr-xr-xdump-bag8
1 files changed, 3 insertions, 5 deletions
diff --git a/dump-bag b/dump-bag
index b1341d59..7cddd1e0 100755
--- a/dump-bag
+++ b/dump-bag
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# Copyright 2015 Lars Wirzenius
+# Copyright 2015-2016 Lars Wirzenius
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -37,7 +37,5 @@ for filename in sys.argv[1:]:
blob = strip_filtering(blob)
bag = obnamlib.deserialise_bag(blob)
- decoded = []
- for obj_blob in bag:
- obj = obnamlib.deserialise_object(obj_blob)
- yaml.safe_dump(obj, stream=sys.stdout, default_flow_style=False)
+ objs = [obnamlib.deserialise_object(obj_blob) for obj_blob in bag]
+ yaml.safe_dump_all(objs, stream=sys.stdout, default_flow_style=False)