Skip to content

Commit

Permalink
New black (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
almarklein authored Feb 22, 2023
1 parent 77a3d85 commit d937163
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 19 deletions.
6 changes: 0 additions & 6 deletions imageio_ffmpeg/_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ def read_frames(
# Generators are automatically closed when they get deleted,
# so the finally block is guaranteed to run.
try:

# ----- Load meta data

# Wait for the log catcher to get the meta information
Expand Down Expand Up @@ -352,7 +351,6 @@ def read_frames(

# Make sure that ffmpeg is terminated.
if p.poll() is None:

# Ask ffmpeg to quit
try:
# I read somewhere that modern ffmpeg on Linux prefers a
Expand Down Expand Up @@ -610,12 +608,10 @@ def write_frames(
# Generators are automatically closed when they get deleted,
# so the finally block is guaranteed to run.
try:

# Just keep going until the generator.close() is called (raises GeneratorExit).
# This could also happen when the generator is deleted somehow.
nframes = 0
while True:

# Get frame
bb = yield

Expand Down Expand Up @@ -654,10 +650,8 @@ def write_frames(
raise

finally:

# Make sure that ffmpeg is terminated.
if p.poll() is None:

# Tell ffmpeg that we're done
try:
p.stdin.close()
Expand Down
1 change: 0 additions & 1 deletion imageio_ffmpeg/_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def get_text(self, timeout=0):
return self._header + "\n" + lines.decode("utf-8", "ignore")

def run(self):

# Create ref here so it still exists even if Py is shutting down
limit_lines_local = limit_lines

Expand Down
7 changes: 0 additions & 7 deletions tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def test_read_frames_resource_warning():

@no_warnings_allowed
def test_reading1():

# Calling returns a generator
gen = imageio_ffmpeg.read_frames(test_file1)
assert isinstance(gen, types.GeneratorType)
Expand Down Expand Up @@ -168,9 +167,7 @@ def test_reading_invalid_video():

@no_warnings_allowed
def test_write1():

for n in (1, 9, 14, 279, 280, 281):

# Prepare for writing
gen = imageio_ffmpeg.write_frames(test_file2, (64, 64))
assert isinstance(gen, types.GeneratorType)
Expand All @@ -197,7 +194,6 @@ def test_write1():

@no_warnings_allowed
def test_write_pix_fmt_in():

sizes = []
for pixfmt, bpp in [("gray", 1), ("rgb24", 3), ("rgba", 4)]:
# Prepare for writing
Expand All @@ -218,7 +214,6 @@ def test_write_pix_fmt_in():

@no_warnings_allowed
def test_write_pix_fmt_out():

sizes = []
for pixfmt in ["gray", "yuv420p"]:
# Prepare for writing
Expand Down Expand Up @@ -303,7 +298,6 @@ def test_write_quality():

@no_warnings_allowed
def test_write_bitrate():

# Mind that we send uniform images, so the difference is marginal

sizes = []
Expand All @@ -326,7 +320,6 @@ def test_write_bitrate():

# @no_warnings_allowed --> will generate warnings abiut macro block size
def test_write_macro_block_size():

frame_sizes = []
for mbz in [None, 10]: # None is default == 16
# Prepare for writing
Expand Down
5 changes: 0 additions & 5 deletions tests/test_terminate.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def test_ffmpeg_version():

@no_warnings_allowed
def test_reader_done():

for i in range(N):
pids0 = get_ffmpeg_pids()
r = imageio_ffmpeg.read_frames(test_file1)
Expand All @@ -48,7 +47,6 @@ def test_reader_done():

@no_warnings_allowed
def test_reader_close():

for i in range(N):
pids0 = get_ffmpeg_pids()
r = imageio_ffmpeg.read_frames(test_file1)
Expand All @@ -65,7 +63,6 @@ def test_reader_close():

@no_warnings_allowed
def test_reader_del():

for i in range(N):
pids0 = get_ffmpeg_pids()
r = imageio_ffmpeg.read_frames(test_file1)
Expand All @@ -83,7 +80,6 @@ def test_reader_del():

@no_warnings_allowed
def test_write_close():

for i in range(N):
pids0 = get_ffmpeg_pids()
w = imageio_ffmpeg.write_frames(test_file2, (64, 64))
Expand All @@ -101,7 +97,6 @@ def test_write_close():

@no_warnings_allowed
def test_write_del():

for i in range(N):
pids0 = get_ffmpeg_pids()
w = imageio_ffmpeg.write_frames(test_file2, (64, 64))
Expand Down

0 comments on commit d937163

Please sign in to comment.