doc/source/vmm_config.rst
branchv0.6.x
changeset 216 0c8c053b451c
parent 215 33f727efa7c4
equal deleted inserted replaced
215:33f727efa7c4 216:0c8c053b451c
   156     :rtype: :const:`None`
   156     :rtype: :const:`None`
   157     :raise ConfigValueError: if a boolean value shout be set (:meth:`bool_new`)
   157     :raise ConfigValueError: if a boolean value shout be set (:meth:`bool_new`)
   158       and it fails
   158       and it fails
   159     :raise ValueError: if an other setter (:attr:`LazyConfigOption.cls`) or
   159     :raise ValueError: if an other setter (:attr:`LazyConfigOption.cls`) or
   160       validator (:attr:`LazyConfigOption.validate`) fails.
   160       validator (:attr:`LazyConfigOption.validate`) fails.
   161     :raise VirtualMailManager.Exceptions.VMMException: if
   161     :raise VirtualMailManager.errors.VMMError: if
   162       :attr:`LazyConfigOption.validate` is set to
   162       :attr:`LazyConfigOption.validate` is set to
   163       :func:`VirtualMailManager.exec_ok` or :func:`VirtualMailManager.is_dir`.
   163       :func:`VirtualMailManager.exec_ok` or :func:`VirtualMailManager.is_dir`.
   164 
   164 
   165 
   165 
   166 LazyConfigOption
   166 LazyConfigOption
   230 
   230 
   231   .. method:: check()
   231   .. method:: check()
   232 
   232 
   233     Checks all section's options for settings w/o a default value.
   233     Checks all section's options for settings w/o a default value.
   234 
   234 
   235     :raise VirtualMailManager.Exceptions.VMMConfigException: if the check fails
   235     :raise VirtualMailManager.errors.ConfigError: if the check fails
   236 
   236 
   237   .. method:: load()
   237   .. method:: load()
   238 
   238 
   239     Loads the configuration read-only.
   239     Loads the configuration read-only.
   240 
   240 
   241     :raise VirtualMailManager.Exceptions.VMMConfigException: if the
   241     :raise VirtualMailManager.errors.ConfigError: if the
   242       configuration syntax is invalid
   242       configuration syntax is invalid
   243 
   243 
   244   .. method:: unicode(section, option)
   244   .. method:: unicode(section, option)
   245 
   245 
   246     Returns the value of the *option* from *section*, converted to Unicode.
   246     Returns the value of the *option* from *section*, converted to Unicode.
   254 
   254 
   255 
   255 
   256 Exceptions
   256 Exceptions
   257 ----------
   257 ----------
   258 
   258 
   259 .. exception:: BadOptionError (msg)
   259 .. exception:: BadOptionError(msg)
   260 
   260 
   261   Bases: :exc:`ConfigParser.Error`
   261   Bases: :exc:`ConfigParser.Error`
   262 
   262 
   263   Raised when a option isn't in the format 'section.option'.
   263   Raised when a option isn't in the format 'section.option'.
   264 
   264 
   265 .. exception:: ConfigValueError (msg)
   265 .. exception:: ConfigValueError(msg)
   266 
   266 
   267   Bases: :exc:`ConfigParser.Error`
   267   Bases: :exc:`ConfigParser.Error`
   268 
   268 
   269   Raised when creating or validating of new values fails.
   269   Raised when creating or validating of new values fails.
   270 
   270 
   271 .. exception:: NoDefaultError (section, option)
   271 .. exception:: NoDefaultError(section, option)
   272 
   272 
   273   Bases: :exc:`ConfigParser.Error`
   273   Bases: :exc:`ConfigParser.Error`
   274 
   274 
   275   Raised when the requested option has no default value.
   275   Raised when the requested option has no default value.