Skip to content

Commit

Permalink
Ensure open handles lists correctly
Browse files Browse the repository at this point in the history
The call to `glob` was causing `list`s of files to fail in `open`. This
fixes that issue by looping over the `list`s contents and concatenating
them.
  • Loading branch information
jakirkham committed Jan 6, 2019
1 parent eda864a commit 7efb5e6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pims/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,13 @@ def open(sequence, **kwargs):
>>> frame_count = len(video) # Number of frames in video
>>> frame_shape = video.frame_shape # Pixel dimensions of video
"""
files = glob.glob(sequence)
if isinstance(sequence, str):
sequence = [sequence]

files = []
for each_seq in sequence:
files.extend(glob.glob(sequence))

if len(files) > 1:
# todo: test if ImageSequence can read the image type,
# delegate to subclasses as needed
Expand Down

0 comments on commit 7efb5e6

Please sign in to comment.