def getFileList(self, request, context): if request.name in self.loginDict: lst = os.listdir(self.path) return DisStorage_pb2.fileList(fileNum=len(lst), nameList=lst, mess='') else: return DisStorage_pb2.fileList(fileNum=-1, nameList=[], mess='Login First!')
def getFileList(self, request, context): self.flstAll, self.flsts, self.paths = self.updateFileList() if request.name in self.loginDict: return DisStorage_pb2.fileList(fileNum=len(self.flstAll), nameList=self.flstAll, mess='') else: return DisStorage_pb2.fileList(fileNum=-1, nameList=[], mess='Login First!')