Test Failed
Push — dev ( 3a28f6...0451e7 )
by Konstantinos
05:08
created

music_album_creation.ffmpeg.ffmpeg.ffmpeg_subject   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A FFMPEGSubject.__call__() 0 2 1
A FFMPEGSubject.__init__() 0 2 1
1
"""FFMpeg Subject that runs ffmpeg in python subprocess."""
2
from software_patterns import Singleton
3
4
from ..run_cli import execute_command_in_subprocess
5
6
__all__ = ['FFMpegSubject']
7
8
9
# Our implementation of the Subject class (see the Proxy pattern)
10
class FFMPEGSubject(metaclass=Singleton):
11
    """The standard FFMPEGSubject class proxies the ffmpeg CLI."""
12
13
    def __init__(self, ffmpeg_binary: str):
14
        self.ffmpeg_binary = ffmpeg_binary
15
16
    def __call__(self, *args, **kwargs):
17
        return execute_command_in_subprocess(self.ffmpeg_binary, *args, **kwargs)
18