Skip to content

Video editing with Python

Fix formatting.

vermontc507dad34130
diff --git a/moviepy/audio/fx/all/__init__.py b/moviepy/audio/fx/all/__init__.py
index 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 warnings
from .. import * # noqa 401,F403
diff --git a/moviepy/decorators.py b/moviepy/decorators.py
index c33edb00..1177f214 100644
--- a/moviepy/decorators.py
+++ b/moviepy/decorators.py
@@ -1,4 +1,5 @@
"""Decorators used by moviepy."""
+
import inspect
import 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.py
index 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 os
import subprocess as sp
import warnings
diff --git a/moviepy/video/fx/all/__init__.py b/moviepy/video/fx/all/__init__.py
index 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 warnings
from moviepy.video.fx import * # noqa F401,F403
diff --git a/moviepy/video/io/ffmpeg_reader.py b/moviepy/video/io/ffmpeg_reader.py
index 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 os
import re
import subprocess as sp
@@ -452,12 +453,12 @@ class FFmpegInfosParser:
# for default streams, set their numbers globally, so it's
# easy to get without iterating all
if 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 chapter
if self._current_chapter:
diff --git a/moviepy/video/tools/credits.py b/moviepy/video/tools/credits.py
index 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 is
difficult to fill everyone needs in this matter.
"""
+
from moviepy.decorators import convert_path_to_string
from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip
from moviepy.video.fx.resize import resize
diff --git a/moviepy/video/tools/cuts.py b/moviepy/video/tools/cuts.py
index 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_threshold
dict_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)