Beispiel #1
0
    def userinfo(self, **kwargs):
        """Retrieve the user summary information.

           :arg str username: username for which the informations are retrieved

           :return: quota, list of filenames"""
        username = kwargs['username']
        userpath = filepath(self.cachedir, username)

        res = {}
        files = list_files(userpath)
        if kwargs['verbose']:
            files_dict = {}
            for file_ in files:
                files_dict[file_] = self.fileinfo(hashkey=file_,username=username)

        res["file_list"] = files_dict if kwargs['verbose'] else list(files)
        res["used_space"] = [get_size(userpath)]

        yield res
Beispiel #2
0
    def userinfo(self, **kwargs):
        """Retrieve the user summary information.

           :arg str username: username for which the informations are retrieved

           :return: quota, list of filenames"""
        username = kwargs['username']
        userpath = filepath(self.cachedir, username)

        res = {}
        files = list_files(userpath)
        if kwargs['verbose']:
            files_dict = {}
            for file_ in files:
                files_dict[file_] = self.fileinfo(hashkey=file_, username=username)

        res["file_list"] = files_dict if kwargs['verbose'] else list(files)
        res["used_space"] = [get_size(userpath)]

        yield res
Beispiel #3
0
 def usedspace(self, **kwargs):
     """Retrieves only the used space of the user"""
     username = kwargs["username"]
     userpath = filepath(self.cachedir, username)
     yield get_size(userpath)
Beispiel #4
0
 def usedspace(self, **kwargs):
     """Retrieves only the used space of the user"""
     username = kwargs["username"]
     userpath = filepath(self.cachedir, username)
     yield get_size(userpath)