You can pull this from the descriptors:
my_enum_descriptor = SomeMessage.DESCRIPTOR.enums_by_name['MyType']
my_enum_descriptor.values_by_number[SomeMessage.FIRST].name
(See the docs on the descriptor module from
http://code.google.com/apis/protocolbuffers/docs/reference/python/index.html
)
On Wed
Hello,
About 2 years ago I used the protobufs for a client-server based
system, and I was quite happy with the results. The system is still
running and has proven to provide an easy to modify communication
protocol, all that thanks to the protobufs.
The only grudge I still hold with the protobufs
Hi there, I have a simple message defined with a repeated field. The
repeated field type is another message type. For example:
Message A {
repeated B b = 1;
}
Message B {
required uint32 x = 1;
}
I'm building up a single A message in memory with quite a few B's. I
am constantly receveiving a
On Aug 26, 2010, at 12:07 , Jean-Sebastien Stoezel wrote:
More specifically how they are parsed from real time datastreams?
You should manually insert a leading "length of next message" field
into the data stream. The Java implementation even has a shortcut
methods for this (see below). In
Got it, Thanks!
In your first statement, I believe the method is actually
"enum_types_by_name" - at least that's what worked for me.
On Aug 26, 12:29 am, Jason Hsueh wrote:
> You can pull this from the descriptors:
> my_enum_descriptor = SomeMessage.DESCRIPTOR.enums_by_name['MyType']
> my_enum_d
Oh, indeed enum_types_by_name is what you want - my bad!
On Thu, Aug 26, 2010 at 5:51 PM, Mike wrote:
> Got it, Thanks!
>
> In your first statement, I believe the method is actually
> "enum_types_by_name" - at least that's what worked for me.
>
> On Aug 26, 12:29 am, Jason Hsueh wrote:
> > You