diff options
author | Lars Wirzenius <liw@liw.fi> | 2014-03-21 07:53:51 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2014-03-21 07:53:51 +0000 |
commit | 4a974f24c686220a89bf943eaeda4965bf39c347 (patch) | |
tree | 153ddf95b420b3229a79201b2a9ceea25a7d7e07 | |
parent | 0628d55f2582af6ffb34ec12a20832e9fad73515 (diff) | |
parent | bfbc97718fa2bcf21e6fe21938b8759192679109 (diff) | |
download | obnam-4a974f24c686220a89bf943eaeda4965bf39c347.tar.gz |
Merge branch 'liw/dump-in-json'
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | debian/control | 6 | ||||
-rw-r--r-- | obnamlib/plugins/dump_repo_plugin.py | 9 |
4 files changed, 10 insertions, 9 deletions
@@ -6,6 +6,9 @@ This file summarizes changes between releases of Obnam. Version 1.8, released UNRELEASED -------------------------------- +* The `dump-repo` command now outputs JSON instead of YAML. The + dependency on PyYAML is no longer. + Bug fixes: * Nemo Inis found a bug in the FUSE plugin (`obnam mount`), where diff --git a/debian/changelog b/debian/changelog index 7e5ef031..188a4197 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ obnam (1.8-1) UNRELEASED; urgency=low * Fix "obnam mount fails to retrieve files over 64KB (obnam restore works fine)" (Closes: #741968) * Fix "typo in debian/control: s/Uploader/Uploaders/" (Closes: #729347) + * Drop dependency on python-yaml, since yaml is no longer used. -- Lars Wirzenius <liw@liw.fi> Tue, 18 Mar 2014 08:42:28 +0000 diff --git a/debian/control b/debian/control index 0c1cef11..5a586830 100644 --- a/debian/control +++ b/debian/control @@ -19,8 +19,7 @@ Build-Depends: debhelper (>= 7.3.8), python-fuse, pandoc, texlive, - lmodern, - python-yaml + lmodern Homepage: http://liw.fi/obnam/ X-Python-Version: >= 2.6 @@ -33,8 +32,7 @@ Depends: ${shlibs:Depends}, ${python:Depends}, ${misc:Depends}, python-paramiko, python-tracing (>= 0.8~), python-cliapp (>= 1.20130808~), - python-fuse, - python-yaml + python-fuse Description: online and disk-based backup application Obnam makes backups. Backups can be stored on local hard disks, or online via the SSH SFTP protocol. The backup server, if used, does not require any diff --git a/obnamlib/plugins/dump_repo_plugin.py b/obnamlib/plugins/dump_repo_plugin.py index 7379ba39..3c09a28d 100644 --- a/obnamlib/plugins/dump_repo_plugin.py +++ b/obnamlib/plugins/dump_repo_plugin.py @@ -14,7 +14,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. -import yaml +import json import obnamlib @@ -31,10 +31,9 @@ class DumpRepositoryPlugin(obnamlib.ObnamPlugin): def cmd_dump_repo(self, args): repo = self.app.get_repository_object() - yaml.safe_dump_all( - self.dump_repository(repo), - stream=self.app.output, - default_flow_style=False) + for obj in self.dump_repository(repo): + json.dump(obj, self.app.output, indent=4) + self.app.output.write('\n') repo.close() def dump_repository(self, repo): |