Lines Matching full:section
102 def _handle_no_value(self, section, key, default): argument
104 msg = ("Value '%s' not found in section '%s'" %
105 (key, section))
111 def get_section_values(self, section): argument
113 Return a config parser object containing a single section of the
116 @param section: Section we want to turn into a config parser object.
117 @return: ConfigParser() object containing all the contents of section.
120 cfgparser.add_section(section)
121 for option, value in self.config.items(section):
122 cfgparser.set(section, option, value)
126 def get_config_value(self, section, key, type=str, argument
130 @param section: Section the key is in.
146 val = self.config.get(section, key)
148 return self._handle_no_value(section, key, default)
151 return self._handle_no_value(section, key, default)
153 return self._convert_value(key, section, val, type)
156 def get_config_value_regex(self, section, key_regex, type=str): argument
157 """Get a dict of configs in given section with key matched to key-regex.
159 @param section: Section the key is in.
168 for option, value in self.config.items(section):
170 configs[option] = self._convert_value(option, section, value,
176 # get_config_value which is mostly called with (section, key, type).
177 def get_config_value_with_fallback(self, section, key, fallback_key, argument
186 @param section: Section the key is in.
191 @param fallback_section: The section the fallback key resides in. In
192 case none is specified, the the same section as
207 fallback_section = section
210 return self.get_config_value(section, key, type, **kwargs)
216 def override_config_value(self, section, key, new_value): argument
219 @param section: Name of the section.
224 self.config.set(section, key, new_value)
249 for section in sections:
250 # add the section if need be
251 if not self.config.has_section(section):
252 self.config.add_section(section)
254 options = override_config.options(section)
256 val = override_config.get(section, option)
257 self.config.set(section, option, val)
290 def _convert_value(self, key, section, value, value_type): argument
323 msg = ("Could not convert %s value %r in section %s to type %s" %
324 (key, sval, section, value_type))