forked from josch/img2pdf
505344f83e
Img2pdf accepts paths containing wildcards such as *.jpg to efficiently refer to multiple input files that match the wildcard expression. Under POSIX environments the command line shell is expected to perform this expansion, however Windows requires the command line utility itself to expand the wildcard expression. Ideally this would be performed by argparse as described in this draft PEP: https://mail.python.org/pipermail/python-ideas/2015-August/035244.html Since argparse doesn't do it, this commit performs expansion directly. Some implementation notes: - Wildcard characters "*" and "?" are not valid in Windows filenames - Code doesn't support bracket wildcards such as [0-3] on Windows since they are valid filename characters - Due to expansion, the images list collected by argparse may contain sub-lists. Code uses chain.from_iterable to create a flat list. - Paths that refer to non-existant files raise an error message, while wildcards that match no files are silently ignored. |
||
---|---|---|
.. | ||
tests | ||
img2pdf.py | ||
img2pdf_test.py | ||
jp2.py |