docstrings for special params

This commit is contained in:
gwen 2012-11-08 09:03:28 +01:00
parent 307a3a00a8
commit 407c74008c
2 changed files with 16 additions and 1 deletions

View file

@ -223,7 +223,14 @@ class Config(object):
return self._getattr(name)
def _getattr(self, name, permissive=False):
"attribute notation mechanism for accessing the value of an option"
"""
attribute notation mechanism for accessing the value of an option
:param name: attribute name
:param permissive: permissive doesn't raise some property error
(see ``_cfgimpl_permissive``)
:return: option's value if name is an option name, OptionDescription
otherwise
"""
# attribute access by passing a path,
# for instance getattr(self, "creole.general.family.adresse_ip_eth0")
if '.' in name:

View file

@ -221,6 +221,14 @@ class Option(HiddenBaseType, DisabledBaseType):
return config._cfgimpl_value_owners[self._name]
def is_default_owner(self, config, all_default=True):
"""
:param config: *must* be only the **parent** config
(not the toplevel config)
:param all_default: only for multi options, if True and the owner list
has something else than "default" returns False, if False and the owner
list has at least one "default" owner, returns True
:return: boolean
"""
if self.is_multi():
owners = self.getowner(config)
for owner in owners: