diff options
author | Jisi Liu <jisi.liu@gmail.com> | 2015-10-05 11:59:43 -0700 |
---|---|---|
committer | Jisi Liu <jisi.liu@gmail.com> | 2015-10-05 11:59:43 -0700 |
commit | 46e8ff63cb67a6520711da5317aaaef04d0414d0 (patch) | |
tree | 64370726fe469f8dfca7b14f8b8cb80b6cc856f6 /python/google/protobuf/text_format.py | |
parent | 0087da9d4775f79c67362cc89c653f3a33a9bae2 (diff) |
Down-integrate from google internal.
Diffstat (limited to 'python/google/protobuf/text_format.py')
-rwxr-xr-x | python/google/protobuf/text_format.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/python/google/protobuf/text_format.py b/python/google/protobuf/text_format.py index 1399223f..e4fadf09 100755 --- a/python/google/protobuf/text_format.py +++ b/python/google/protobuf/text_format.py @@ -28,9 +28,17 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Copyright 2007 Google Inc. All Rights Reserved. +"""Contains routines for printing protocol messages in text format. -"""Contains routines for printing protocol messages in text format.""" +Simple usage example: + + # Create a proto object and serialize it to a text proto string. + message = my_proto_pb2.MyMessage(foo='bar') + text_proto = text_format.MessageToString(message) + + # Parse a text proto string. + message = text_format.Parse(text_proto, my_proto_pb2.MyMessage()) +""" __author__ = 'kenton@google.com (Kenton Varda)' |