From: Michael Vrable Date: Fri, 11 Apr 2008 01:10:03 +0000 (-0700) Subject: Squeeze extra blank lines when dumping metadata logs. X-Git-Url: https://git.vrable.net/?a=commitdiff_plain;h=953c9bac420a83d6a384c024cfec2ab3b096cdea;p=cumulus.git Squeeze extra blank lines when dumping metadata logs. In lbs-util, squeeze out extra blank lines in the output of the read-metadata command. Extra blank lines may appear in the input, particularly when delta-encoding metadata logs, but to produce uniform-looking outputs, delete these extra blank lines. --- diff --git a/lbs-util b/lbs-util index d617705..942a601 100755 --- a/lbs-util +++ b/lbs-util @@ -126,7 +126,13 @@ def cmd_read_metadata(snapshot): d = lbs.parse_full(store.load_snapshot(snapshot)) check_version(d['Format']) metadata = lbs.read_metadata(store, d['Root']) + blank = True for l in metadata: + if l == '\n': + if blank: continue + blank = True + else: + blank = False sys.stdout.write(l) store.cleanup()