def __init__(driver, name, bases, members):
    """
        Register drivers by name in one dictionary and by extension in another.
        """
    type.__init__(driver, name, bases, members)
    if members.get('register', True):
        driver.by_name[driver.driver_name] = driver
        for ext in driver.extensions:
            driver.by_extension[ext] = driver
