8000 #34: re-add overwrite_output operator but have it raise an exception · zeesumwang/ffmpeg-python@7989c5d · GitHub
[go: up one dir, main page]

Skip to content

Commit 7989c5d

Browse files
committed
kkroening#34: re-add overwrite_output operator but have it raise an exception
1 parent 39f3ece commit 7989c5d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

ffmpeg/_ffmpeg.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ def input(filename, **kwargs):
2323
return InputNode(input.__name__, kwargs=kwargs).stream()
2424

2525

26+
@output_operator()
27+
def overwrite_output(stream):
28+
"""No longer supported; see ``overwrite_output`` parameter of ``get_args`` function instead.
29+
"""
30+
raise NameError('`overwrite_output` operator is no longer supported; see `overwrite_output` parameter of '
31+
'`get_args` function instead')
32+
33+
2634
@output_operator()
2735
def merge_outputs(*streams):
2836
"""Include all given outputs in one ffmpeg command line
@@ -50,4 +58,5 @@ def output(stream, filename, **kwargs):
5058
'input',
5159
'merge_outputs',
5260
'output',
61+
'overwrite_output',
5362
]

ffmpeg/tests/test_ffmpeg.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ def test_stream_repr():
9999
assert repr(dummy_out) == "dummy()[{!r}] <{}>".format(dummy_out.label, dummy_out.node.short_hash)
100100

101101

102+
def test_overwrite_output():
103+
with pytest.raises(NameError):
104+
ffmpeg.input('dummy.mp4').output('dummy2.mp4').overwrite_output()
105+
106+
102107
def test_get_args_simple():
103108
out_file = ffmpeg.input('dummy.mp4').output('dummy2.mp4')
104109
assert out_file.get_args() == ['-i', 'dummy.mp4', 'dummy2.mp4', '-y']

0 commit comments

Comments
 (0)
0