[py] improve style for demo_filter.py
authorPaul Brossier <piem@piem.org>
Sun, 4 Nov 2018 19:57:33 +0000 (20:57 +0100)
committerPaul Brossier <piem@piem.org>
Sun, 4 Nov 2018 19:57:33 +0000 (20:57 +0100)
python/demos/demo_filter.py

index 1eb5773..ab3df6d 100755 (executable)
@@ -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} <input_file> [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]