Commit c7bdceff authored by Antoine Millet's avatar Antoine Millet
Browse files

Updated docstrings.

parent 4ba7c8b5
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
#!/usr/bin/env python
#coding=utf8

'''
Main class of cc-server.
'''

from __future__ import absolute_import

import logging
@@ -208,6 +212,15 @@ class CCServer(object):
        client.shutdown()

    def check(self, login, method, tql=None):
        '''
        Check if the user can call the specified method with specified TQL.

        :param login: the login of the user
        :param method: the method to call
        :param tql: the tql passed in argument of the method
        :return: True if user have rights, else False
        '''

        rights = self.conf.show(login)['rights']
        if tql is not None:
            objects = self.list(tql, pure=True)
+8 −0
Original line number Diff line number Diff line
#!/usr/bin/env python
#coding=utf8

'''
Local client representation classes.
'''

from threading import RLock
from datetime import datetime

@@ -64,6 +68,10 @@ class CCClient(object):
        return ':'.join(peer.split(':')[:-1])

    def shutdown(self):
        '''
        Shutdown the connection to the client.
        '''

        self.server.manager.shutdown_client(self.connection.get_fd())

    def get_tags(self):