1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-11-29 12:44:31 +01:00

better docstring

This commit is contained in:
kakwa 2015-07-20 00:41:29 +02:00
parent 174eba0b5f
commit ca49587870

View File

@ -13,15 +13,18 @@ class PPolicy:
def __init__(self, config, logger): def __init__(self, config, logger):
""" Password policy constructor """ Password policy constructor
:dict config: the configuration of the ppolicy :param config: the configuration of the ppolicy
:logger logger: a python logger :type config: hash {'config key': 'value'}
:param logger: the cherrypy error logger object
"type logger: python logger
""" """
pass pass
def check(self, password): def check(self, password):
""" Check if a password match the ppolicy """ Check if a password match the ppolicy
:str password: the password to check :param password: the password to check
:type password: string
:rtype: dict with keys 'match' a boolean :rtype: dict with keys 'match' a boolean
(True if ppolicy matches, False otherwise) (True if ppolicy matches, False otherwise)
and 'reason', an explaination string and 'reason', an explaination string
@ -39,10 +42,12 @@ class PPolicy:
def get_param(self, param, default=None): def get_param(self, param, default=None):
""" Get a parameter in config (handle default value) """ Get a parameter in config (handle default value)
:str param: name of the paramter to recover :param param: name of the parameter to recover
:str default: the default value, raises an exception :type param: string
:param default: the default value, raises an exception
if param is not in configuration and default if param is not in configuration and default
is None (which is the default value). is None (which is the default value).
:type default: string or None
""" """
if param in self.config: if param in self.config:
return self.config[param] return self.config[param]