diff --git a/quicktex/cli/__init__.py b/quicktex/cli/__init__.py index fca36d5..84ea843 100644 --- a/quicktex/cli/__init__.py +++ b/quicktex/cli/__init__.py @@ -1,17 +1,19 @@ from PIL import Image from typing import List -import pathlib import click def get_decoded_extensions(feature: str = 'open') -> List[str]: + """Gets a list of extensions for Pillow formats supporting a supplied feature""" extensions = Image.registered_extensions() # using registered_extensions() triggers lazy loading of format data formats = getattr(Image, feature.upper()).keys() return [ext for ext, fmt in extensions.items() if fmt in formats] +# noinspection PyUnusedLocal def validate_decoded_extension(ctx, param, value): + """Check if an extension for a decoded image is valid""" if value[0] != '.': value = '.' + value