mirror of
https://github.com/keirf/greaseweazle-firmware.git
synced 2025-10-31 11:06:44 -07:00
Return list of supported extensions when an unknown one is provided
This commit is contained in:
@@ -171,7 +171,7 @@ def get_image_class(name):
|
||||
else:
|
||||
_, ext = os.path.splitext(name)
|
||||
error.check(ext.lower() in image_types,
|
||||
"%s: Unrecognised file suffix '%s'" % (name, ext))
|
||||
"%s: Unrecognised file suffix '%s' (known suffixes: %s)" % (name, ext, ', '.join(map(lambda t: t[0], image_types))))
|
||||
typename = image_types[ext.lower()]
|
||||
mod = importlib.import_module('greaseweazle.image.' + typename.lower())
|
||||
return mod.__dict__[typename]
|
||||
|
||||
Reference in New Issue
Block a user