# Path: wa/framework/exception.py
# class ConfigError(WAError):
#     """Raised when configuration provided is invalid. This error suggests that
#     the user should modify their config and try again."""


from collections import namedtuple
from wa.framework.exception import ConfigError
from wa.framework.target.runtime_config import (SysfileValuesRuntimeConfig,
                                                HotplugRuntimeConfig,
                                                CpufreqRuntimeConfig,
                                                CpuidleRuntimeConfig,
                                                AndroidRuntimeConfig)
from wa.utils.types import obj_dict, caseless_string
        self.set_runtime_parameters(parameters)
        for cfg in self.runtime_configs:
            cfg.commit()

    # Stores a set of parameters performing isolated validation when appropriate
    def set_runtime_parameters(self, parameters):
        for name, value in parameters.items():
            cfg = self.get_config_for_name(name)
            if cfg is None:
                msg = 'Unsupported runtime parameter: "{}"'
                raise ConfigError(msg.format(name))
            cfg.set_runtime_parameter(name, value)

    def clear_runtime_parameters(self):
        for cfg in self.runtime_configs:
            cfg.clear()
            cfg.set_defaults()

    def get_config_for_name(self, name):
        name = caseless_string(name)
        for k, v in self.runtime_params.items():
            if name == k:
                return v.rt_config
        return None

    def get_cfg_point(self, name):
        name = caseless_string(name)
        for k, v in self.runtime_params.items():
            if name == k or name in v.cfg_point.aliases:
                return v.cfg_point

# Path: wa/framework/exception.py
# class ConfigError(WAError):
#     """Raised when configuration provided is invalid. This error suggests that
#     the user should modify their config and try again."""


# Path: wa/framework/target/runtime_parameter_manager.py
from collections import namedtuple
from wa.framework.exception import ConfigError
from wa.framework.target.runtime_config import (SysfileValuesRuntimeConfig,
                                                HotplugRuntimeConfig,
                                                CpufreqRuntimeConfig,
                                                CpuidleRuntimeConfig,
                                                AndroidRuntimeConfig)
from wa.utils.types import obj_dict, caseless_string

        self.set_runtime_parameters(parameters)
        for cfg in self.runtime_configs:
            cfg.commit()

    # Stores a set of parameters performing isolated validation when appropriate
    def set_runtime_parameters(self, parameters):
        for name, value in parameters.items():
            cfg = self.get_config_for_name(name)
            if cfg is None:
                msg = 'Unsupported runtime parameter: "{}"'
                raise ConfigError(msg.format(name))
            cfg.set_runtime_parameter(name, value)

    def clear_runtime_parameters(self):
        for cfg in self.runtime_configs:
            cfg.clear()
            cfg.set_defaults()

    def get_config_for_name(self, name):
        name = caseless_string(name)
        for k, v in self.runtime_params.items():
            if name == k:
                return v.rt_config
        return None

    def get_cfg_point(self, name):
        name = caseless_string(name)
        for k, v in self.runtime_params.items():
            if name == k or name in v.cfg_point.aliases:
                return v.cfg_point

        raise ConfigError('Unknown runtime parameter: {}'.format(name))