Skip to content

Video editing with Python

style: fix code formatting (Black, flake8)

K Kollmannf5a6fde76271
diff --git a/examples/soundtrack.py b/examples/soundtrack.py
index 48adbb99..c2efd8c0 100644
--- a/examples/soundtrack.py
+++ b/examples/soundtrack.py
@@ -1,4 +1,5 @@
"""A simple test script on how to put a soundtrack to a movie."""
+
from moviepy import *
diff --git a/moviepy/Clip.py b/moviepy/Clip.py
index 5c2d88b2..733b2e04 100644
--- a/moviepy/Clip.py
+++ b/moviepy/Clip.py
@@ -1,6 +1,7 @@
"""Implements the central object of MoviePy, the Clip, and all the methods that
are common to the two subclasses of Clip, VideoClip and AudioClip.
"""
+
import copy as _copy
from functools import reduce
from numbers import Real
@@ -635,8 +636,9 @@ class Clip:
return self.get_frame(key)
def __del__(self):
- # WARNING: as stated in close() above, if we call close, it closes clips even
- # if shallow copies are still in used, leading to some bugs: https://github.com/Zulko/moviepy/issues/1994
+ # WARNING: as stated in close() above, if we call close, it closes clips
+ # even if shallow copies are still in used, leading to some bugs, see:
+ # https://github.com/Zulko/moviepy/issues/1994
# so don't call self.close() here, rather do it manually in the code.
pass
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 621e3585..e080ab3d 100644
--- a/moviepy/decorators.py
+++ b/moviepy/decorators.py
@@ -1,4 +1,5 @@
"""Decorators used by moviepy."""
+
import inspect
import os
diff --git a/moviepy/tools.py b/moviepy/tools.py
index a260e75b..3dda375e 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 b7be9717..f871bd8f 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
@@ -451,12 +452,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/tests/test_VideoFileClip.py b/tests/test_VideoFileClip.py
index e92f78e0..bd8f996e 100644
--- a/tests/test_VideoFileClip.py
+++ b/tests/test_VideoFileClip.py
@@ -1,4 +1,5 @@
"""Video file clip tests meant to be run with pytest."""
+
import copy
import os