From 8ebcd3db81ae5c0a8580997c137c0c8dd54adcff Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sun, 4 Nov 2018 20:57:33 +0100 Subject: [PATCH] [py] improve style for demo_filter.py --- python/demos/demo_filter.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/python/demos/demo_filter.py b/python/demos/demo_filter.py index 1eb57730..ab3df6dc 100755 --- a/python/demos/demo_filter.py +++ b/python/demos/demo_filter.py @@ -4,6 +4,7 @@ import sys import os.path import aubio + def apply_filter(path, target): # open input file, get its samplerate s = aubio.source(path) @@ -27,19 +28,20 @@ def apply_filter(path, target): # count frames read total_frames += read # end of file reached - if read < s.hop_size: break + if read < s.hop_size: + break # print some info duration = total_frames / float(samplerate) input_str = "input: {:s} ({:.2f} s, {:d} Hz)" output_str = "output: {:s}, A-weighting filtered ({:d} frames total)" - print (input_str.format(s.uri, duration, samplerate)) - print (output_str.format(o.uri, total_frames)) + print(input_str.format(s.uri, duration, samplerate)) + print(output_str.format(o.uri, total_frames)) if __name__ == '__main__': usage = "{:s} [output_file]".format(sys.argv[0]) if not 1 < len(sys.argv) < 4: - print (usage) + print(usage) sys.exit(1) if len(sys.argv) < 3: input_path = sys.argv[1] -- 2.11.0