From 0f3a84fc7b61d410800be5909a52469ed66fd309 Mon Sep 17 00:00:00 2001 From: ZhengXu Date: Tue, 6 Oct 2015 18:52:00 -0500 Subject: [PATCH] Add document for MergeFromText --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 53cce4d..f44a25c 100644 --- a/README.md +++ b/README.md @@ -82,8 +82,10 @@ person_obj['phone'] = [{'number': '4567'}, Person.PhoneNumber(number="1234")] # We append a pair of text-format method to the protobuf objects, which are ```python adr_book_obj = AddressBook() - adr_book_obj.ParseFromText(adr_book_text) # parse text format protobuf from adr_book_text - print adr_book_obj.SerializeToText() # print out the text format protobuf + adr_book_obj.MergeFromText(adr_book_text) # merge text format protobuf to adr_book_text + adr_book_obj.ParseFromText(adr_book_text) + # clear the content of adr_book_obj first and then merge from the text format protobuf + print adr_book_obj.SerializeToText() # print out the text format protobuf from object ```