diff options
Diffstat (limited to 'generator/google/protobuf/message.py')
-rw-r--r-- | generator/google/protobuf/message.py | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/generator/google/protobuf/message.py b/generator/google/protobuf/message.py index 606f735..6ec2f8b 100644 --- a/generator/google/protobuf/message.py +++ b/generator/google/protobuf/message.py @@ -1,6 +1,6 @@ # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. -# https://developers.google.com/protocol-buffers/ +# http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -36,6 +36,7 @@ __author__ = 'robinson@google.com (Will Robinson)' + class Error(Exception): pass class DecodeError(Error): pass class EncodeError(Error): pass @@ -176,11 +177,7 @@ class Message(object): raise NotImplementedError def ParseFromString(self, serialized): - """Parse serialized protocol buffer data into this message. - - Like MergeFromString(), except we clear the object first and - do not return the value that MergeFromString returns. - """ + """Like MergeFromString(), except we clear the object first.""" self.Clear() self.MergeFromString(serialized) @@ -232,21 +229,12 @@ class Message(object): raise NotImplementedError def HasField(self, field_name): - """Checks if a certain field is set for the message, or if any field inside - a oneof group is set. Note that if the field_name is not defined in the - message descriptor, ValueError will be raised.""" + """Checks if a certain field is set for the message. Note if the + field_name is not defined in the message descriptor, ValueError will be + raised.""" raise NotImplementedError def ClearField(self, field_name): - """Clears the contents of a given field, or the field set inside a oneof - group. If the name neither refers to a defined field or oneof group, - ValueError is raised.""" - raise NotImplementedError - - def WhichOneof(self, oneof_group): - """Returns the name of the field that is set inside a oneof group, or - None if no field is set. If no group with the given name exists, ValueError - will be raised.""" raise NotImplementedError def HasExtension(self, extension_handle): @@ -255,9 +243,6 @@ class Message(object): def ClearExtension(self, extension_handle): raise NotImplementedError - def DiscardUnknownFields(self): - raise NotImplementedError - def ByteSize(self): """Returns the serialized size of this message. Recursively calls ByteSize() on all contained messages. |