VirtualMailManager/config.py
branchv0.6.x
changeset 342 b0c971f943dc
parent 326 8f8d9c4c8332
child 348 ca7575401549
equal deleted inserted replaced
341:6709d0faf2f5 342:b0c971f943dc
   120           * `NoSectionError`
   120           * `NoSectionError`
   121           * `NoOptionError`
   121           * `NoOptionError`
   122         """
   122         """
   123         sect_opt = section_option.lower().split('.')
   123         sect_opt = section_option.lower().split('.')
   124         # TODO: cache it
   124         # TODO: cache it
   125         if len(sect_opt) != 2:  # do we need a regexp to check the format?
   125         if len(sect_opt) != 2 or not sect_opt[0] or not sect_opt[1]:
   126             raise BadOptionError(_(u"Bad format: '%s' - expected: "
   126             raise BadOptionError(_(u"Bad format: '%s' - expected: "
   127                                    u"section.option") %
   127                                    u"section.option") %
   128                                  get_unicode(section_option))
   128                                  get_unicode(section_option))
   129         if not sect_opt[0] in self._cfg:
   129         if not sect_opt[0] in self._cfg:
   130             raise NoSectionError(sect_opt[0])
   130             raise NoSectionError(sect_opt[0])