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
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
def usedspace(self, **kwargs): """Retrieves only the used space of the user""" username = kwargs["username"] userpath = filepath(self.cachedir, username) yield get_size(userpath)