1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-06-08 03:57:47 +02:00

fix docstring in ldapcherry/backend/__init__.py

This commit is contained in:
kakwa 2015-07-21 00:53:07 +02:00
parent ab5f8e13ae
commit 8617ed5ae5

View File

@ -12,6 +12,7 @@ class Backend:
def __init__(self, config, logger, name, attrslist, key): def __init__(self, config, logger, name, attrslist, key):
""" Initialize the backend """ Initialize the backend
:param config: the configuration of the backend :param config: the configuration of the backend
:type config: dict {'config key': 'value'} :type config: dict {'config key': 'value'}
:param logger: the cherrypy error logger object :param logger: the cherrypy error logger object
@ -27,6 +28,7 @@ class Backend:
def auth(self, username, password): def auth(self, username, password):
""" Check authentication against the backend """ Check authentication against the backend
:param username: 'key' attribute of the user :param username: 'key' attribute of the user
:type username: string :type username: string
:param password: password of the user :param password: password of the user
@ -37,20 +39,26 @@ class Backend:
def add_user(self, attrs): def add_user(self, attrs):
""" Add a user to the backend """ Add a user to the backend
:param attrs: attributes of the user :param attrs: attributes of the user
:type attrs: dict ({<attr>: <value>}) :type attrs: dict ({<attr>: <value>})
.. warning:: raise UserAlreadyExists if user already exists
""" """
pass pass
def del_user(self, username): def del_user(self, username):
""" Delete a user from the backend """ Delete a user from the backend
:param username: 'key' attribute of the user :param username: 'key' attribute of the user
:type username: string :type username: string
""" """
pass pass
def set_attrs(self, username, attrs): def set_attrs(self, username, attrs):
""" Set a list of attributes for a given user """ Set a list of attributes for a given user
:param username: 'key' attribute of the user :param username: 'key' attribute of the user
:type username: string :type username: string
:param attrs: attributes of the user :param attrs: attributes of the user
@ -60,6 +68,7 @@ class Backend:
def add_to_groups(self, username, groups): def add_to_groups(self, username, groups):
""" Add a user to a list of groups """ Add a user to a list of groups
:param username: 'key' attribute of the user :param username: 'key' attribute of the user
:type username: string :type username: string
:param groups: list of groups :param groups: list of groups
@ -69,15 +78,19 @@ class Backend:
def del_from_groups(self, username, groups): def del_from_groups(self, username, groups):
""" Delete a user from a list of groups """ Delete a user from a list of groups
:param username: 'key' attribute of the user :param username: 'key' attribute of the user
:type username: string :type username: string
:param groups: list of groups :param groups: list of groups
:type groups: list of strings :type groups: list of strings
.. warning:: raise GroupDoesntExist if group doesn't exist
""" """
pass pass
def search(self, searchstring): def search(self, searchstring):
""" Search backend for users """ Search backend for users
:param searchstring: the search string :param searchstring: the search string
:type searchstring: string :type searchstring: string
:rtype: dict of dict ( {<user attr key>: {<attr>: <value>}} ) :rtype: dict of dict ( {<user attr key>: {<attr>: <value>}} )
@ -86,14 +99,18 @@ class Backend:
def get_user(self, username): def get_user(self, username):
""" Get a user's attributes """ Get a user's attributes
:param username: 'key' attribute of the user :param username: 'key' attribute of the user
:type username: string :type username: string
:rtype: dict ( {<attr>: <value>} ) :rtype: dict ( {<attr>: <value>} )
.. warning:: raise UserDoesntExist if user doesn't exist
""" """
return {} return {}
def get_groups(self, username): def get_groups(self, username):
""" Get a user's groups """ Get a user's groups
:param username: 'key' attribute of the user :param username: 'key' attribute of the user
:type username: string :type username: string
:rtype: list of groups :rtype: list of groups