def get_supported_extensions(): """Returns a dict mapping file extension string to Configuration class that can handle it""" supported_extensions = {} for cls in Configuration.__subclasses__(): for ext in cls.file_extensions: supported_extensions[ext] = cls return supported_extensions