Add an ext_to_format function

This commit is contained in:
Sambhav Kothari
2018-02-27 23:40:58 +05:30
parent 9c70a509f4
commit 23ea30b1d5

View File

@@ -40,6 +40,10 @@ def supported_extensions():
return [ext for exts, name in supported_formats() for ext in exts]
def ext_to_format(ext):
return _extensions.get(ext, None)
def guess_format(filename, options=_formats):
"""Select the best matching file type amongst supported formats."""
results = []