Skip to content

Commit

Permalink
Taming linter
Browse files Browse the repository at this point in the history
  • Loading branch information
deniszh committed Jan 19, 2024
1 parent 10751fe commit 67b9c0c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions bin/whisper-resize.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@
if not options.silent:
size = os.stat(path).st_size
blocks = os.stat(path).st_blocks
print('Old file: %s (%d bytes, %d blocks*%d=%d bytes on disk)' % (path, size, blocks, 512, blocks*512))
print('Old file: %s (%d bytes, %d blocks*%d=%d bytes on disk)'
% (path, size, blocks, 512, blocks * 512))

info = whisper.info(path)

Expand Down Expand Up @@ -127,15 +128,17 @@
print('Creating new whisper database: %s' % newfile)

try:
whisper.create(newfile, new_archives, xFilesFactor=xff, aggregationMethod=aggregationMethod,
sparse=options.sparse, useFallocate=options.fallocate)
whisper.create(newfile, new_archives, xFilesFactor=xff,
aggregationMethod=aggregationMethod, sparse=options.sparse,
useFallocate=options.fallocate)
except whisper.WhisperException as exc:
raise SystemExit('[ERROR] %s' % str(exc))

size = os.stat(newfile).st_size
blocks = os.stat(newfile).st_blocks
if not options.quiet and not options.silent:
print('Created: %s (%d bytes, %d blocks*%d=%d bytes on disk)' % (newfile, size, blocks, 512, blocks*512))
print('Created: %s (%d bytes, %d blocks*%d=%d bytes on disk)'
% (newfile, size, blocks, 512, blocks * 512))

if options.aggregate:
# This is where data will be interpolated (best effort)
Expand Down Expand Up @@ -230,10 +233,10 @@
if not options.silent:
size = os.stat(path).st_size
blocks = os.stat(path).st_blocks
print('New file: %s (%d bytes, %d blocks*%d=%d bytes on disk)' % (path, size, blocks, 512, blocks*512))
print('New file: %s (%d bytes, %d blocks*%d=%d bytes on disk)'
% (path, size, blocks, 512, blocks * 512))

if options.nobackup:
if not options.quiet and not options.silent:
print("Unlinking backup: %s" % backup)
os.unlink(backup)

0 comments on commit 67b9c0c

Please sign in to comment.