mirror of
https://github.com/kkroening/ffmpeg-python.git
synced 2025-08-07 10:29:47 +08:00
#34: re-add overwrite_output operator but have it raise an exception
This commit is contained in:
parent
39f3ecec37
commit
7989c5d8a3
@ -23,6 +23,14 @@ def input(filename, **kwargs):
|
||||
return InputNode(input.__name__, kwargs=kwargs).stream()
|
||||
|
||||
|
||||
@output_operator()
|
||||
def overwrite_output(stream):
|
||||
"""No longer supported; see ``overwrite_output`` parameter of ``get_args`` function instead.
|
||||
"""
|
||||
raise NameError('`overwrite_output` operator is no longer supported; see `overwrite_output` parameter of '
|
||||
'`get_args` function instead')
|
||||
|
||||
|
||||
@output_operator()
|
||||
def merge_outputs(*streams):
|
||||
"""Include all given outputs in one ffmpeg command line
|
||||
@ -50,4 +58,5 @@ __all__ = [
|
||||
'input',
|
||||
'merge_outputs',
|
||||
'output',
|
||||
'overwrite_output',
|
||||
]
|
||||
|
@ -99,6 +99,11 @@ def test_stream_repr():
|
||||
assert repr(dummy_out) == "dummy()[{!r}] <{}>".format(dummy_out.label, dummy_out.node.short_hash)
|
||||
|
||||
|
||||
def test_overwrite_output():
|
||||
with pytest.raises(NameError):
|
||||
ffmpeg.input('dummy.mp4').output('dummy2.mp4').overwrite_output()
|
||||
|
||||
|
||||
def test_get_args_simple():
|
||||
out_file = ffmpeg.input('dummy.mp4').output('dummy2.mp4')
|
||||
assert out_file.get_args() == ['-i', 'dummy.mp4', 'dummy2.mp4', '-y']
|
||||
|
Loading…
x
Reference in New Issue
Block a user