Example #1
0
	def _addEntry(self, container, section, option, value, source):
		option = option.strip()
		opttype = '='
		if option[-1] in imap(itemgetter(0), ConfigEntry.OptTypeDesc.keys()):
			opttype = option[-1] + '='
			option = option[:-1].strip()
		container.append(ConfigEntry(section.strip(), option, value.strip(), opttype, source))
 def _addEntry(self, container, section, option, value, source):
     option = option.strip()
     opttype = '='
     if option[-1] in ['+', '-', '*', '?', '^']:
         opttype = option[-1] + '='
         option = option[:-1].strip()
     container.append(
         ConfigEntry(section.strip(), option, value.strip(), opttype,
                     source))
Example #3
0
 def _add_entry(self, container, section, option, value, source):
     opttype = '='
     try:
         option = option.strip()
         if option[-1] in imap(itemgetter(0),
                               ConfigEntry.map_opt_type2desc.keys()):
             opttype = option[-1] + '='
             option = option[:-1].strip()
         container.append(
             ConfigEntry(section.strip(), option, value.strip(), opttype,
                         source))
     except Exception:
         raise ConfigError(
             'Unable to register config value [%s] %s %s %s (from %s)' %
             (section, option, opttype, value, source))
Example #4
0
 def _createEntry(self, option_list, value, opttype, source, specific,
                  reverse):
     section = self._getSection(specific)
     if reverse:
         section += '!'
     return ConfigEntry(section, option_list[0], value, opttype, source)