VirtualMailManager/Config.py
branchv0.6.x
changeset 290 e2785e04f92e
parent 287 1e77dd639fa3
child 291 7ef3f117a230
equal deleted inserted replaced
289:142f188f7552 290:e2785e04f92e
   122 
   122 
   123         """
   123         """
   124         sect_opt = section_option.lower().split('.')
   124         sect_opt = section_option.lower().split('.')
   125         # TODO: cache it
   125         # TODO: cache it
   126         if len(sect_opt) != 2:  # do we need a regexp to check the format?
   126         if len(sect_opt) != 2:  # do we need a regexp to check the format?
   127             raise BadOptionError(
   127             raise BadOptionError(_(u"Bad format: '%s' - expected: "
   128                         _(u"Bad format: '%s' - expected: section.option") %
   128                                    u"section.option") %
   129                                  get_unicode(section_option))
   129                                  get_unicode(section_option))
   130         if not sect_opt[0] in self._cfg:
   130         if not sect_opt[0] in self._cfg:
   131             raise NoSectionError(sect_opt[0])
   131             raise NoSectionError(sect_opt[0])
   132         if not sect_opt[1] in self._cfg[sect_opt[0]]:
   132         if not sect_opt[1] in self._cfg[sect_opt[0]]:
   133             raise NoOptionError(sect_opt[1], sect_opt[0])
   133             raise NoOptionError(sect_opt[1], sect_opt[0])