diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2014-11-10 17:34:54 -0800 |
---|---|---|
committer | Feng Xiao <xfxyjwf@gmail.com> | 2014-11-10 17:34:54 -0800 |
commit | 6ef984af4b0c63c1c33127a12dcfc8e6359f0c9e (patch) | |
tree | d17c61ff9f3ae28224fbddac6d26bfc59e2cf755 /python/google/protobuf/text_format.py | |
parent | baca1a8a1aa180c42de6278d3b8286c4496c6a10 (diff) | |
download | protobuf-6ef984af4b0c63c1c33127a12dcfc8e6359f0c9e.tar.gz protobuf-6ef984af4b0c63c1c33127a12dcfc8e6359f0c9e.tar.bz2 protobuf-6ef984af4b0c63c1c33127a12dcfc8e6359f0c9e.zip |
Down-integrate from internal code base.
Diffstat (limited to 'python/google/protobuf/text_format.py')
-rwxr-xr-x | python/google/protobuf/text_format.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/python/google/protobuf/text_format.py b/python/google/protobuf/text_format.py index 2429fa59..b2f3d32c 100755 --- a/python/google/protobuf/text_format.py +++ b/python/google/protobuf/text_format.py @@ -112,15 +112,17 @@ def PrintMessage(message, out, indent=0, as_utf8=False, as_one_line=False, for element in value: PrintField(field, element, out, indent, as_utf8, as_one_line, pointy_brackets=pointy_brackets, + use_index_order=use_index_order, float_format=float_format) else: PrintField(field, value, out, indent, as_utf8, as_one_line, pointy_brackets=pointy_brackets, + use_index_order=use_index_order, float_format=float_format) def PrintField(field, value, out, indent=0, as_utf8=False, as_one_line=False, - pointy_brackets=False, float_format=None): + pointy_brackets=False, use_index_order=False, float_format=None): """Print a single field name/value pair. For repeated fields, the value should be a single element.""" @@ -148,6 +150,7 @@ def PrintField(field, value, out, indent=0, as_utf8=False, as_one_line=False, PrintFieldValue(field, value, out, indent, as_utf8, as_one_line, pointy_brackets=pointy_brackets, + use_index_order=use_index_order, float_format=float_format) if as_one_line: out.write(' ') @@ -157,6 +160,7 @@ def PrintField(field, value, out, indent=0, as_utf8=False, as_one_line=False, def PrintFieldValue(field, value, out, indent=0, as_utf8=False, as_one_line=False, pointy_brackets=False, + use_index_order=False, float_format=None): """Print a single field value (not including name). For repeated fields, the value should be a single element.""" @@ -173,12 +177,14 @@ def PrintFieldValue(field, value, out, indent=0, as_utf8=False, out.write(' %s ' % openb) PrintMessage(value, out, indent, as_utf8, as_one_line, pointy_brackets=pointy_brackets, + use_index_order=use_index_order, float_format=float_format) out.write(closeb) else: out.write(' %s\n' % openb) PrintMessage(value, out, indent + 2, as_utf8, as_one_line, pointy_brackets=pointy_brackets, + use_index_order=use_index_order, float_format=float_format) out.write(' ' * indent + closeb) elif field.cpp_type == descriptor.FieldDescriptor.CPPTYPE_ENUM: |