コード例 #1
0
 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!')
コード例 #2
0
 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!')