They are accessible, atleast somewhat. You can generate python code
for your custom_options.proto and then compile my_message.proto where
you use the options into a FileDescriptorSet in my_message.pb (with
protoc -o).
After that, you should be able to access the options like:
import custom_options_pb2
import google.protobuf.descriptor_pb2 as descriptor
fdesc =
descriptor.FileDescriptorSet.FromString(open("my_message.pb").read())
print
fdesc.file[0].message_type[0].field[0].options.HasExtension(custom_options_pb2.myoption)
However, if you just generate python code from my_message.proto, the
extensions are not directly accessible. The generated python module
includes the FileDescriptorSet, though, so you can always parse it
from there using the above method.
--
Petteri Aimonen
jpa (at) kapsi.fi
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/protobuf?hl=en.