diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2012-10-29 18:20:15 +0200 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2012-10-29 18:20:15 +0200 |
commit | 28b0136ea4dcd045f0422d16a25b7d82b0d2aaee (patch) | |
tree | 7ec5fd5962a733b53e2bc93ea90618df58e5806f /generator/nanopb_pb2.py | |
parent | 9e0ee92f0a42ce2c5c9d4bf4f1d7d822caf1c561 (diff) |
Improve .proto options parsing.
Options can now be defined on command line, file, message or in field
scope.
Update issue 12
Status: Started
Diffstat (limited to 'generator/nanopb_pb2.py')
-rw-r--r-- | generator/nanopb_pb2.py | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/generator/nanopb_pb2.py b/generator/nanopb_pb2.py index f2fbeefd..09378194 100644 --- a/generator/nanopb_pb2.py +++ b/generator/nanopb_pb2.py @@ -7,15 +7,33 @@ from google.protobuf import descriptor_pb2 # @@protoc_insertion_point(imports) +import google.protobuf.descriptor_pb2 + DESCRIPTOR = descriptor.FileDescriptor( name='nanopb.proto', package='', - serialized_pb='\n\x0cnanopb.proto\x1a google/protobuf/descriptor.proto\"4\n\rNanoPBOptions\x12\x10\n\x08max_size\x18\x01 \x01(\x05\x12\x11\n\tmax_count\x18\x02 \x01(\x05:>\n\x06nanopb\x12\x1d.google.protobuf.FieldOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptions') + serialized_pb='\n\x0cnanopb.proto\x1a google/protobuf/descriptor.proto\"4\n\rNanoPBOptions\x12\x10\n\x08max_size\x18\x01 \x01(\x05\x12\x11\n\tmax_count\x18\x02 \x01(\x05:E\n\x0enanopb_fileopt\x12\x1c.google.protobuf.FileOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptions:G\n\rnanopb_msgopt\x12\x1f.google.protobuf.MessageOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptions:>\n\x06nanopb\x12\x1d.google.protobuf.FieldOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptions') +NANOPB_FILEOPT_FIELD_NUMBER = 1010 +nanopb_fileopt = descriptor.FieldDescriptor( + name='nanopb_fileopt', full_name='nanopb_fileopt', index=0, + number=1010, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + options=None) +NANOPB_MSGOPT_FIELD_NUMBER = 1010 +nanopb_msgopt = descriptor.FieldDescriptor( + name='nanopb_msgopt', full_name='nanopb_msgopt', index=1, + number=1010, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + options=None) NANOPB_FIELD_NUMBER = 1010 nanopb = descriptor.FieldDescriptor( - name='nanopb', full_name='nanopb', index=0, + name='nanopb', full_name='nanopb', index=2, number=1010, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, @@ -57,8 +75,7 @@ _NANOPBOPTIONS = descriptor.Descriptor( serialized_end=102, ) -import google.protobuf.descriptor_pb2 - +DESCRIPTOR.message_types_by_name['NanoPBOptions'] = _NANOPBOPTIONS class NanoPBOptions(message.Message): __metaclass__ = reflection.GeneratedProtocolMessageType @@ -66,6 +83,10 @@ class NanoPBOptions(message.Message): # @@protoc_insertion_point(class_scope:NanoPBOptions) +nanopb_fileopt.message_type = _NANOPBOPTIONS +google.protobuf.descriptor_pb2.FileOptions.RegisterExtension(nanopb_fileopt) +nanopb_msgopt.message_type = _NANOPBOPTIONS +google.protobuf.descriptor_pb2.MessageOptions.RegisterExtension(nanopb_msgopt) nanopb.message_type = _NANOPBOPTIONS google.protobuf.descriptor_pb2.FieldOptions.RegisterExtension(nanopb) # @@protoc_insertion_point(module_scope) |