From ca4958787026e25ee2683cc7b89a654dedcba0df Mon Sep 17 00:00:00 2001 From: kakwa Date: Mon, 20 Jul 2015 00:41:29 +0200 Subject: [PATCH] better docstring --- ldapcherry/ppolicy/__init__.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ldapcherry/ppolicy/__init__.py b/ldapcherry/ppolicy/__init__.py index 5b4f066..7818266 100644 --- a/ldapcherry/ppolicy/__init__.py +++ b/ldapcherry/ppolicy/__init__.py @@ -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]