Skip to content

Commit

Permalink
applied isort
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Zulkower committed Nov 20, 2024
1 parent 03bdffe commit 3f9eed1
Show file tree
Hide file tree
Showing 55 changed files with 140 additions and 111 deletions.
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import pydata_sphinx_theme
from pygments.styles import get_all_styles


# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
Expand Down
2 changes: 1 addition & 1 deletion moviepy/Clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
from functools import reduce
from numbers import Real
from operator import add
from typing import TYPE_CHECKING, List

import numpy as np
import proglog

from typing import List, TYPE_CHECKING

if TYPE_CHECKING:
from moviepy.Effect import Effect
Expand Down
3 changes: 2 additions & 1 deletion moviepy/Effect.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import copy as _copy
from abc import ABCMeta, abstractmethod

from moviepy.Clip import Clip
import copy as _copy


class Effect(metaclass=ABCMeta):
Expand Down
9 changes: 5 additions & 4 deletions moviepy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

from moviepy.audio import fx as afx
from moviepy.audio.AudioClip import (
AudioArrayClip,
AudioClip,
CompositeAudioClip,
AudioArrayClip,
concatenate_audioclips,
)
from moviepy.audio.io.AudioFileClip import AudioFileClip
from moviepy.Effect import Effect
from moviepy.tools import convert_to_seconds
from moviepy.version import __version__
from moviepy.video import fx as vfx, tools as videotools
Expand All @@ -22,17 +23,17 @@
from moviepy.video.io.display_in_notebook import display_in_notebook
from moviepy.video.io.ImageSequenceClip import ImageSequenceClip
from moviepy.video.io.VideoFileClip import VideoFileClip
from moviepy.Effect import Effect
from moviepy.video.VideoClip import (
BitmapClip,
ColorClip,
DataVideoClip,
ImageClip,
TextClip,
VideoClip,
DataVideoClip,
UpdatedVideoClip,
VideoClip,
)


# Add display in notebook to video and audioclip
VideoClip.display_in_notebook = display_in_notebook
AudioClip.display_in_notebook = display_in_notebook
Expand Down
6 changes: 3 additions & 3 deletions moviepy/audio/fx/AudioDelay.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from dataclasses import dataclass

import numpy as np

from moviepy.audio.AudioClip import CompositeAudioClip
from moviepy.audio.fx.MultiplyVolume import MultiplyVolume
from moviepy.decorators import audio_video_effect

from moviepy.Clip import Clip
from moviepy.decorators import audio_video_effect
from moviepy.Effect import Effect
from dataclasses import dataclass


@dataclass
Expand Down
8 changes: 4 additions & 4 deletions moviepy/audio/fx/AudioFadeIn.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import numpy as np
from dataclasses import dataclass

from moviepy.decorators import audio_video_effect
from moviepy.tools import convert_to_seconds
import numpy as np

from moviepy.Clip import Clip
from moviepy.decorators import audio_video_effect
from moviepy.Effect import Effect
from dataclasses import dataclass
from moviepy.tools import convert_to_seconds


@dataclass
Expand Down
8 changes: 4 additions & 4 deletions moviepy/audio/fx/AudioFadeOut.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import numpy as np
from dataclasses import dataclass

from moviepy.decorators import audio_video_effect
from moviepy.tools import convert_to_seconds
import numpy as np

from moviepy.Clip import Clip
from moviepy.decorators import audio_video_effect
from moviepy.Effect import Effect
from dataclasses import dataclass
from moviepy.tools import convert_to_seconds


@dataclass
Expand Down
6 changes: 3 additions & 3 deletions moviepy/audio/fx/AudioLoop.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from moviepy.audio.AudioClip import concatenate_audioclips
from moviepy.decorators import audio_video_effect
from dataclasses import dataclass

from moviepy.audio.AudioClip import concatenate_audioclips
from moviepy.Clip import Clip
from moviepy.decorators import audio_video_effect
from moviepy.Effect import Effect
from dataclasses import dataclass


@dataclass
Expand Down
6 changes: 3 additions & 3 deletions moviepy/audio/fx/AudioNormalize.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from moviepy.audio.fx.MultiplyVolume import MultiplyVolume
from moviepy.decorators import audio_video_effect
from dataclasses import dataclass

from moviepy.audio.fx.MultiplyVolume import MultiplyVolume
from moviepy.Clip import Clip
from moviepy.decorators import audio_video_effect
from moviepy.Effect import Effect
from dataclasses import dataclass


@dataclass
Expand Down
4 changes: 2 additions & 2 deletions moviepy/audio/fx/MultiplyStereoVolume.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from moviepy.decorators import audio_video_effect
from dataclasses import dataclass

from moviepy.Clip import Clip
from moviepy.decorators import audio_video_effect
from moviepy.Effect import Effect
from dataclasses import dataclass


@dataclass
Expand Down
8 changes: 4 additions & 4 deletions moviepy/audio/fx/MultiplyVolume.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import numpy as np
from dataclasses import dataclass

from moviepy.decorators import audio_video_effect
from moviepy.tools import convert_to_seconds
import numpy as np

from moviepy.Clip import Clip
from moviepy.decorators import audio_video_effect
from moviepy.Effect import Effect
from dataclasses import dataclass
from moviepy.tools import convert_to_seconds


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion moviepy/tools.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""Misc. useful functions that can be used at many places in the program."""

import os
import platform
import subprocess as sp
import warnings

import proglog
import platform


OS_NAME = os.name
Expand Down
25 changes: 9 additions & 16 deletions moviepy/video/VideoClip.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,23 @@

import copy as _copy
import os
import threading
from numbers import Real
from typing import TYPE_CHECKING, List, Union

import numpy as np
import proglog
from imageio.v3 import imread, imwrite
from imageio.v2 import imread as imread_v2
from imageio.v3 import imread, imwrite
from PIL import Image, ImageDraw, ImageFont

import threading
from moviepy.video.io.ffplay_previewer import ffplay_preview_video

from typing import Union, List, TYPE_CHECKING

if TYPE_CHECKING:
from moviepy.Effect import Effect

from moviepy.video.fx.Resize import Resize
from moviepy.video.fx.Rotate import Rotate
from moviepy.video.fx.Crop import Crop
from moviepy.audio.fx.MultiplyVolume import MultiplyVolume
from moviepy.video.fx.MultiplySpeed import MultiplySpeed

from moviepy.Clip import Clip
from moviepy.decorators import (
add_mask_if_none,
Expand All @@ -40,15 +35,13 @@
requires_fps,
use_clip_fps_by_default,
)

from moviepy.tools import (
extensions_dict,
find_extension,
)
from moviepy.tools import extensions_dict, find_extension
from moviepy.video.fx.Crop import Crop
from moviepy.video.fx.MultiplySpeed import MultiplySpeed
from moviepy.video.fx.Resize import Resize
from moviepy.video.fx.Rotate import Rotate
from moviepy.video.io.ffmpeg_writer import ffmpeg_write_video
from moviepy.video.io.gif_writers import (
write_gif_with_imageio,
)
from moviepy.video.io.gif_writers import write_gif_with_imageio
from moviepy.video.tools.drawing import blit


Expand Down
3 changes: 2 additions & 1 deletion moviepy/video/compositing/CompositeVideoClip.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""Main video composition interface of MoviePy."""

from functools import reduce

import numpy as np
from PIL import Image
from functools import reduce

from moviepy.audio.AudioClip import CompositeAudioClip
from moviepy.video.VideoClip import ColorClip, VideoClip
Expand Down
3 changes: 2 additions & 1 deletion moviepy/video/fx/AccelDecel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from moviepy.Effect import Effect
from dataclasses import dataclass

from moviepy.Effect import Effect


@dataclass
class AccelDecel(Effect):
Expand Down
4 changes: 3 additions & 1 deletion moviepy/video/fx/BlackAndWhite.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from dataclasses import dataclass

import numpy as np

from moviepy.Effect import Effect
from dataclasses import dataclass


@dataclass
Expand Down
3 changes: 2 additions & 1 deletion moviepy/video/fx/Blink.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from moviepy.Effect import Effect
from dataclasses import dataclass

from moviepy.Effect import Effect


@dataclass
class Blink(Effect):
Expand Down
3 changes: 2 additions & 1 deletion moviepy/video/fx/Crop.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from dataclasses import dataclass

from moviepy.Clip import Clip
from moviepy.Effect import Effect
from dataclasses import dataclass


@dataclass
Expand Down
4 changes: 2 additions & 2 deletions moviepy/video/fx/CrossFadeIn.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from moviepy.Clip import Clip
from moviepy.Effect import Effect
from dataclasses import dataclass

from moviepy.Clip import Clip
from moviepy.Effect import Effect
from moviepy.video.fx.FadeIn import FadeIn


Expand Down
4 changes: 2 additions & 2 deletions moviepy/video/fx/CrossFadeOut.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from moviepy.Clip import Clip
from moviepy.Effect import Effect
from dataclasses import dataclass

from moviepy.Clip import Clip
from moviepy.Effect import Effect
from moviepy.video.fx.FadeOut import FadeOut


Expand Down
3 changes: 2 additions & 1 deletion moviepy/video/fx/EvenSize.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from dataclasses import dataclass

from moviepy.Clip import Clip
from moviepy.Effect import Effect
from dataclasses import dataclass


@dataclass
Expand Down
4 changes: 2 additions & 2 deletions moviepy/video/fx/FadeIn.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import numpy as np
from dataclasses import dataclass

import numpy as np

from moviepy.Clip import Clip
from moviepy.Effect import Effect
from dataclasses import dataclass


@dataclass
Expand Down
3 changes: 2 additions & 1 deletion moviepy/video/fx/FadeOut.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from dataclasses import dataclass

import numpy as np

from moviepy.Clip import Clip
from moviepy.Effect import Effect
from dataclasses import dataclass


@dataclass
Expand Down
4 changes: 2 additions & 2 deletions moviepy/video/fx/Freeze.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from moviepy.video.compositing.CompositeVideoClip import concatenate_videoclips
from dataclasses import dataclass

from moviepy.Clip import Clip
from moviepy.Effect import Effect
from dataclasses import dataclass
from moviepy.video.compositing.CompositeVideoClip import concatenate_videoclips


@dataclass
Expand Down
6 changes: 3 additions & 3 deletions moviepy/video/fx/FreezeRegion.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip
from moviepy.video.fx.Crop import Crop
from dataclasses import dataclass

from moviepy.Clip import Clip
from moviepy.Effect import Effect
from dataclasses import dataclass
from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip
from moviepy.video.fx.Crop import Crop


@dataclass
Expand Down
3 changes: 2 additions & 1 deletion moviepy/video/fx/GammaCorrection.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from dataclasses import dataclass

from moviepy.Clip import Clip
from moviepy.Effect import Effect
from dataclasses import dataclass


@dataclass
Expand Down
4 changes: 3 additions & 1 deletion moviepy/video/fx/HeadBlur.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from dataclasses import dataclass

import numpy as np
from PIL import Image, ImageDraw, ImageFilter

from moviepy.Clip import Clip
from moviepy.Effect import Effect
from dataclasses import dataclass


@dataclass
Expand Down
3 changes: 2 additions & 1 deletion moviepy/video/fx/InvertColors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from dataclasses import dataclass

from moviepy.Clip import Clip
from moviepy.Effect import Effect
from dataclasses import dataclass


@dataclass
Expand Down
3 changes: 2 additions & 1 deletion moviepy/video/fx/Loop.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from dataclasses import dataclass

from moviepy.Clip import Clip
from moviepy.Effect import Effect
from dataclasses import dataclass


@dataclass
Expand Down
Loading

0 comments on commit 3f9eed1

Please sign in to comment.