Video editing with Python
Fix formatting.
vermontc507dad34130
diff --git a/moviepy/audio/fx/all/__init__.py b/moviepy/audio/fx/all/__init__.pyindex c6cadf1c..d51e6595 100644--- a/moviepy/audio/fx/all/__init__.py+++ b/moviepy/audio/fx/all/__init__.py@@ -4,6 +4,7 @@ moviepy.audio.fx.all is deprecated.Use the fx method directly from the clip instance (e.g. ``clip.audio_normalize(...)``)or import the function from moviepy.audio.fx instead."""+import warningsfrom .. import * # noqa 401,F403diff --git a/moviepy/decorators.py b/moviepy/decorators.pyindex c33edb00..1177f214 100644--- a/moviepy/decorators.py+++ b/moviepy/decorators.py@@ -1,4 +1,5 @@"""Decorators used by moviepy."""+import inspectimport os@@ -88,7 +89,11 @@ def preprocess_args(preprocess_func, varnames):def wrapper(func, *args, **kwargs):new_args = [- preprocess_func(arg) if (name in varnames) and (arg is not None) else arg+ (+ preprocess_func(arg)+ if (name in varnames) and (arg is not None)+ else arg+ )for (arg, name) in zip(args, argnames)]new_kwargs = {diff --git a/moviepy/tools.py b/moviepy/tools.pyindex 8817c2d9..2778cd2d 100644--- a/moviepy/tools.py+++ b/moviepy/tools.py@@ -1,4 +1,5 @@"""Misc. useful functions that can be used at many places in the program."""+import osimport subprocess as spimport warningsdiff --git a/moviepy/video/fx/all/__init__.py b/moviepy/video/fx/all/__init__.pyindex 34b0627d..0e4d6f2f 100644--- a/moviepy/video/fx/all/__init__.py+++ b/moviepy/video/fx/all/__init__.py@@ -4,6 +4,7 @@ moviepy.video.fx.all is deprecated.Use the fx method directly from the clip instance (e.g. ``clip.resize(...)``)or import the function from moviepy.video.fx instead."""+import warningsfrom moviepy.video.fx import * # noqa F401,F403diff --git a/moviepy/video/io/ffmpeg_reader.py b/moviepy/video/io/ffmpeg_reader.pyindex 616deff6..700b1860 100644--- a/moviepy/video/io/ffmpeg_reader.py+++ b/moviepy/video/io/ffmpeg_reader.py@@ -1,4 +1,5 @@"""Implements all the functions to read a video or a picture using ffmpeg."""+import osimport reimport subprocess as sp@@ -452,12 +453,12 @@ class FFmpegInfosParser:# for default streams, set their numbers globally, so it's# easy to get without iterating allif self._current_stream["default"]:- self.result[- f"default_{stream_type_lower}_input_number"- ] = input_number- self.result[- f"default_{stream_type_lower}_stream_number"- ] = stream_number+ self.result[f"default_{stream_type_lower}_input_number"] = (+ input_number+ )+ self.result[f"default_{stream_type_lower}_stream_number"] = (+ stream_number+ )# exit chapterif self._current_chapter:diff --git a/moviepy/video/tools/credits.py b/moviepy/video/tools/credits.pyindex f5b04025..a7bf9fb5 100644--- a/moviepy/video/tools/credits.py+++ b/moviepy/video/tools/credits.py@@ -1,6 +1,7 @@"""Contains different functions to make end and opening credits, even though it isdifficult to fill everyone needs in this matter."""+from moviepy.decorators import convert_path_to_stringfrom moviepy.video.compositing.CompositeVideoClip import CompositeVideoClipfrom moviepy.video.fx.resize import resizediff --git a/moviepy/video/tools/cuts.py b/moviepy/video/tools/cuts.pyindex 40ff5fca..bb6efdfe 100644--- a/moviepy/video/tools/cuts.py+++ b/moviepy/video/tools/cuts.py@@ -253,7 +253,7 @@ class FramesMatches(list):matching_frames = [] # the final result.- for (t, frame) in clip.iter_frames(with_times=True, logger=logger):+ for t, frame in clip.iter_frames(with_times=True, logger=logger):flat_frame = 1.0 * frame.flatten()F_norm_sq = dot_product(flat_frame, flat_frame)@@ -359,7 +359,7 @@ class FramesMatches(list):nomatch_threshold = match_thresholddict_starts = defaultdict(lambda: [])- for (start, end, min_distance, max_distance) in self:+ for start, end, min_distance, max_distance in self:dict_starts[start].append([end, min_distance, max_distance])starts_ends = sorted(dict_starts.items(), key=lambda k: k[0])@@ -445,7 +445,7 @@ class FramesMatches(list):MoviePy - Building file foo/00000128_00000372.gif with imageio.MoviePy - Building file foo/00000140_00000360.gif with imageio."""- for (start, end, _, _) in self:+ for start, end, _, _ in self:name = "%s/%08d_%08d.gif" % (gifs_dir, 100 * start, 100 * end)clip.subclip(start, end).write_gif(name, **kwargs)