Lines Matching defs:config
1 """A singleton class for accessing global config values
6 # The config values can be stored in 3 config files:
10 # When the code is running in Moblab, config values in moblab config override
11 # values in global config, and config values in shadow config override values
12 # in both moblab and global config.
14 # Config values in shadow config will override values in global config.
43 # Check if the config files are at autotest's root dir
51 # Check if the config files are at autotest's client dir
80 """Object to access config values."""
91 def config(self):
94 If the instance dict doesn't have a config key, this descriptor
95 will be called to ensure the config file is parsed (setting the
96 config key in the instance dict as a side effect). Once the
97 instance dict has a config key, that value will be used in
105 @config.setter
106 def config(self, value):
107 """Set config attribute.
115 """Check if this is a stand alone client that does not need config."""
140 This is useful if a config section is being used like a
149 if self.config.has_section(section):
150 return collections.OrderedDict(self.config.items(section))
157 Return a config parser object containing a single section of the
160 @param section: Section we want to turn into a config parser object.
165 for option, value in self.config.items(section):
188 val = self.config.get(section, key)
209 for option, value in self.config.items(section):
258 """Override a value from the config file with a new value.
264 self.config.set(section, key, new_value)
269 Reset all values to those found in the config files (undoes all
276 """Merge existing config values with the ones in given override_config.
278 @param override_config: Configs to override existing config values.
280 # overwrite whats in config with whats in override_config
284 if not self.config.has_section(section):
285 self.config.add_section(section)
290 self.config.set(section, option, val)
294 """Parse config files."""
295 self.config = ConfigParser.ConfigParser()
297 self.config.read(self.config_file)
301 # If it's running in Moblab, read moblab config file if exists,
302 # overwrite the value in global config.
312 # other config
363 return self.config.sections()