| OLD | NEW |
| 1 # Protocol Buffers - Google's data interchange format | 1 # Protocol Buffers - Google's data interchange format |
| 2 # Copyright 2008 Google Inc. All rights reserved. | 2 # Copyright 2008 Google Inc. All rights reserved. |
| 3 # http://code.google.com/p/protobuf/ | 3 # http://code.google.com/p/protobuf/ |
| 4 # | 4 # |
| 5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
| 6 # modification, are permitted provided that the following conditions are | 6 # modification, are permitted provided that the following conditions are |
| 7 # met: | 7 # met: |
| 8 # | 8 # |
| 9 # * Redistributions of source code must retain the above copyright | 9 # * Redistributions of source code must retain the above copyright |
| 10 # notice, this list of conditions and the following disclaimer. | 10 # notice, this list of conditions and the following disclaimer. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 FIELD_TYPE_TO_WIRE_TYPE: A dictionary with field typed and their | 44 FIELD_TYPE_TO_WIRE_TYPE: A dictionary with field typed and their |
| 45 coresponding wire types. | 45 coresponding wire types. |
| 46 TYPE_TO_DESERIALIZE_METHOD: A dictionary with field types and deserialization | 46 TYPE_TO_DESERIALIZE_METHOD: A dictionary with field types and deserialization |
| 47 function. | 47 function. |
| 48 """ | 48 """ |
| 49 | 49 |
| 50 __author__ = 'robinson@google.com (Will Robinson)' | 50 __author__ = 'robinson@google.com (Will Robinson)' |
| 51 | 51 |
| 52 import sys ##PY25 | 52 import sys ##PY25 |
| 53 if sys.version < '2.6': bytes = str ##PY25 | 53 if sys.version < '2.6': bytes = str ##PY25 |
| 54 from google.protobuf.internal import api_implementation | 54 from protobuf26.internal import api_implementation |
| 55 from google.protobuf.internal import decoder | 55 from protobuf26.internal import decoder |
| 56 from google.protobuf.internal import encoder | 56 from protobuf26.internal import encoder |
| 57 from google.protobuf.internal import wire_format | 57 from protobuf26.internal import wire_format |
| 58 from google.protobuf import descriptor | 58 from protobuf26 import descriptor |
| 59 | 59 |
| 60 _FieldDescriptor = descriptor.FieldDescriptor | 60 _FieldDescriptor = descriptor.FieldDescriptor |
| 61 | 61 |
| 62 | 62 |
| 63 def GetTypeChecker(field): | 63 def GetTypeChecker(field): |
| 64 """Returns a type checker for a message field of the specified types. | 64 """Returns a type checker for a message field of the specified types. |
| 65 | 65 |
| 66 Args: | 66 Args: |
| 67 field: FieldDescriptor object for this field. | 67 field: FieldDescriptor object for this field. |
| 68 | 68 |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 wire_format.WIRETYPE_LENGTH_DELIMITED, | 319 wire_format.WIRETYPE_LENGTH_DELIMITED, |
| 320 _FieldDescriptor.TYPE_BYTES: | 320 _FieldDescriptor.TYPE_BYTES: |
| 321 wire_format.WIRETYPE_LENGTH_DELIMITED, | 321 wire_format.WIRETYPE_LENGTH_DELIMITED, |
| 322 _FieldDescriptor.TYPE_UINT32: wire_format.WIRETYPE_VARINT, | 322 _FieldDescriptor.TYPE_UINT32: wire_format.WIRETYPE_VARINT, |
| 323 _FieldDescriptor.TYPE_ENUM: wire_format.WIRETYPE_VARINT, | 323 _FieldDescriptor.TYPE_ENUM: wire_format.WIRETYPE_VARINT, |
| 324 _FieldDescriptor.TYPE_SFIXED32: wire_format.WIRETYPE_FIXED32, | 324 _FieldDescriptor.TYPE_SFIXED32: wire_format.WIRETYPE_FIXED32, |
| 325 _FieldDescriptor.TYPE_SFIXED64: wire_format.WIRETYPE_FIXED64, | 325 _FieldDescriptor.TYPE_SFIXED64: wire_format.WIRETYPE_FIXED64, |
| 326 _FieldDescriptor.TYPE_SINT32: wire_format.WIRETYPE_VARINT, | 326 _FieldDescriptor.TYPE_SINT32: wire_format.WIRETYPE_VARINT, |
| 327 _FieldDescriptor.TYPE_SINT64: wire_format.WIRETYPE_VARINT, | 327 _FieldDescriptor.TYPE_SINT64: wire_format.WIRETYPE_VARINT, |
| 328 } | 328 } |
| OLD | NEW |