mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-22 09:24:21 +01:00
better docstring
This commit is contained in:
parent
174eba0b5f
commit
ca49587870
@ -13,15 +13,18 @@ class PPolicy:
|
||||
def __init__(self, config, logger):
|
||||
""" Password policy constructor
|
||||
|
||||
:dict config: the configuration of the ppolicy
|
||||
:logger logger: a python logger
|
||||
:param config: the configuration of the ppolicy
|
||||
:type config: hash {'config key': 'value'}
|
||||
:param logger: the cherrypy error logger object
|
||||
"type logger: python logger
|
||||
"""
|
||||
pass
|
||||
|
||||
def check(self, password):
|
||||
""" 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
|
||||
(True if ppolicy matches, False otherwise)
|
||||
and 'reason', an explaination string
|
||||
@ -39,10 +42,12 @@ class PPolicy:
|
||||
def get_param(self, param, default=None):
|
||||
""" Get a parameter in config (handle default value)
|
||||
|
||||
:str param: name of the paramter to recover
|
||||
:str default: the default value, raises an exception
|
||||
:param param: name of the parameter to recover
|
||||
:type param: string
|
||||
:param default: the default value, raises an exception
|
||||
if param is not in configuration and default
|
||||
is None (which is the default value).
|
||||
:type default: string or None
|
||||
"""
|
||||
if param in self.config:
|
||||
return self.config[param]
|
||||
|
Loading…
Reference in New Issue
Block a user