Info output improvements.

This commit is contained in:
Jonas Borgström 2010-10-25 19:57:54 +02:00
parent ad2ccff560
commit f1f54b7713
2 changed files with 7 additions and 1 deletions

View File

@ -28,7 +28,7 @@ class Archive(object):
def load(self, id):
self.id = id
data, hash = self.crypto.decrypt(self.store.get(NS_ARCHIVE_METADATA, self.id))
data, self.hash = self.crypto.decrypt(self.store.get(NS_ARCHIVE_METADATA, self.id))
self.metadata = msgpack.unpackb(data)
assert self.metadata['version'] == 1

View File

@ -71,6 +71,12 @@ class Archiver(object):
archive = Archive(store, crypto, args.archive.archive)
cache = Cache(store, archive.crypto)
osize, csize, usize = archive.stats(cache)
print 'Name:', archive.metadata['name']
print 'Hostname:', archive.metadata['hostname']
print 'Username:', archive.metadata['username']
print 'Time:', archive.metadata['time']
print 'Command line:', ' '.join(archive.metadata['cmdline'])
print 'Number of Files:', len(archive.items)
print 'Original size:', pretty_size(osize)
print 'Compressed size:', pretty_size(csize)
print 'Unique data:', pretty_size(usize)