def deleteFile(stub, cur_node, user_input): try: toDelete = cur_node.path + '/' + user_input.split()[1] except: print(colored('Please specify file path')) return cur_node if filetree.FileTree.isUniquePath(toDelete): print(colored('No such file.', 'red')) return cur_node pakage = MasterForClient_pb2.FilePath( path=toDelete ) ack = stub.deleteFile(pakage) print(ack.msg) fetch(stub) return filetree.FileTree.seek(cur_node.path)
def deleteFile(stub): toDelete = input('the file to delete: ') pakage = MasterForClient_pb2.FilePath(path=toDelete) ack = stub.deleteFile(pakage) print(ack.msg)