summaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-11-17 15:07:12 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-12-29 20:26:57 +0200
commit356535da9bd79252e5365a6e5648b7fcd28b367c (patch)
treedcf8d3d3784d6691d16f2ac7b4b5bfecb2840c25 /generator
parentf4146edf01b8226709538a46919c666c37ebb50b (diff)
Move the generator .proto files to a subdir, and get rid of precompiled versions.
Diffstat (limited to 'generator')
-rwxr-xr-xgenerator/nanopb_generator.py4
-rw-r--r--generator/nanopb_pb2.py163
-rw-r--r--generator/plugin_pb2.py161
-rw-r--r--generator/proto/Makefile (renamed from generator/Makefile)2
-rw-r--r--generator/proto/__init__.py0
-rw-r--r--generator/proto/nanopb.proto (renamed from generator/nanopb.proto)0
-rw-r--r--generator/proto/plugin.proto (renamed from generator/plugin.proto)0
7 files changed, 4 insertions, 326 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index d67fe94..0002409 100755
--- a/generator/nanopb_generator.py
+++ b/generator/nanopb_generator.py
@@ -16,7 +16,7 @@ except:
raise
try:
- import nanopb_pb2
+ import proto.nanopb_pb2 as nanopb_pb2
except:
print
print "***************************************************************"
@@ -1025,7 +1025,7 @@ def main_cli():
def main_plugin():
'''Main function when invoked as a protoc plugin.'''
- import plugin_pb2
+ import proto.plugin_pb2 as plugin_pb2
data = sys.stdin.read()
request = plugin_pb2.CodeGeneratorRequest.FromString(data)
diff --git a/generator/nanopb_pb2.py b/generator/nanopb_pb2.py
deleted file mode 100644
index ef1931f..0000000
--- a/generator/nanopb_pb2.py
+++ /dev/null
@@ -1,163 +0,0 @@
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-
-from google.protobuf import descriptor
-from google.protobuf import message
-from google.protobuf import reflection
-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\"\x92\x01\n\rNanoPBOptions\x12\x10\n\x08max_size\x18\x01 \x01(\x05\x12\x11\n\tmax_count\x18\x02 \x01(\x05\x12$\n\x04type\x18\x03 \x01(\x0e\x32\n.FieldType:\nFT_DEFAULT\x12\x18\n\nlong_names\x18\x04 \x01(\x08:\x04true\x12\x1c\n\rpacked_struct\x18\x05 \x01(\x08:\x05\x66\x61lse*Z\n\tFieldType\x12\x0e\n\nFT_DEFAULT\x10\x00\x12\x0f\n\x0b\x46T_CALLBACK\x10\x01\x12\x0e\n\nFT_POINTER\x10\x04\x12\r\n\tFT_STATIC\x10\x02\x12\r\n\tFT_IGNORE\x10\x03: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:E\n\x0enanopb_enumopt\x12\x1c.google.protobuf.EnumOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptions:>\n\x06nanopb\x12\x1d.google.protobuf.FieldOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptionsB\x1a\n\x18\x66i.kapsi.koti.jpa.nanopb')
-
-_FIELDTYPE = descriptor.EnumDescriptor(
- name='FieldType',
- full_name='FieldType',
- filename=None,
- file=DESCRIPTOR,
- values=[
- descriptor.EnumValueDescriptor(
- name='FT_DEFAULT', index=0, number=0,
- options=None,
- type=None),
- descriptor.EnumValueDescriptor(
- name='FT_CALLBACK', index=1, number=1,
- options=None,
- type=None),
- descriptor.EnumValueDescriptor(
- name='FT_POINTER', index=2, number=4,
- options=None,
- type=None),
- descriptor.EnumValueDescriptor(
- name='FT_STATIC', index=3, number=2,
- options=None,
- type=None),
- descriptor.EnumValueDescriptor(
- name='FT_IGNORE', index=4, number=3,
- options=None,
- type=None),
- ],
- containing_type=None,
- options=None,
- serialized_start=199,
- serialized_end=289,
-)
-
-
-FT_DEFAULT = 0
-FT_CALLBACK = 1
-FT_POINTER = 4
-FT_STATIC = 2
-FT_IGNORE = 3
-
-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_ENUMOPT_FIELD_NUMBER = 1010
-nanopb_enumopt = descriptor.FieldDescriptor(
- name='nanopb_enumopt', full_name='nanopb_enumopt', 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,
- is_extension=True, extension_scope=None,
- options=None)
-NANOPB_FIELD_NUMBER = 1010
-nanopb = descriptor.FieldDescriptor(
- name='nanopb', full_name='nanopb', index=3,
- 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)
-
-
-_NANOPBOPTIONS = descriptor.Descriptor(
- name='NanoPBOptions',
- full_name='NanoPBOptions',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- descriptor.FieldDescriptor(
- name='max_size', full_name='NanoPBOptions.max_size', index=0,
- number=1, type=5, cpp_type=1, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- descriptor.FieldDescriptor(
- name='max_count', full_name='NanoPBOptions.max_count', index=1,
- number=2, type=5, cpp_type=1, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- descriptor.FieldDescriptor(
- name='type', full_name='NanoPBOptions.type', index=2,
- number=3, type=14, cpp_type=8, label=1,
- has_default_value=True, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- descriptor.FieldDescriptor(
- name='long_names', full_name='NanoPBOptions.long_names', index=3,
- number=4, type=8, cpp_type=7, label=1,
- has_default_value=True, default_value=True,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- descriptor.FieldDescriptor(
- name='packed_struct', full_name='NanoPBOptions.packed_struct', index=4,
- number=5, type=8, cpp_type=7, label=1,
- has_default_value=True, default_value=False,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- options=None,
- is_extendable=False,
- extension_ranges=[],
- serialized_start=51,
- serialized_end=197,
-)
-
-_NANOPBOPTIONS.fields_by_name['type'].enum_type = _FIELDTYPE
-DESCRIPTOR.message_types_by_name['NanoPBOptions'] = _NANOPBOPTIONS
-
-class NanoPBOptions(message.Message):
- __metaclass__ = reflection.GeneratedProtocolMessageType
- DESCRIPTOR = _NANOPBOPTIONS
-
- # @@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_enumopt.message_type = _NANOPBOPTIONS
-google.protobuf.descriptor_pb2.EnumOptions.RegisterExtension(nanopb_enumopt)
-nanopb.message_type = _NANOPBOPTIONS
-google.protobuf.descriptor_pb2.FieldOptions.RegisterExtension(nanopb)
-# @@protoc_insertion_point(module_scope)
diff --git a/generator/plugin_pb2.py b/generator/plugin_pb2.py
deleted file mode 100644
index 2d8c09d..0000000
--- a/generator/plugin_pb2.py
+++ /dev/null
@@ -1,161 +0,0 @@
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-
-from google.protobuf import descriptor
-from google.protobuf import message
-from google.protobuf import reflection
-from google.protobuf import descriptor_pb2
-# @@protoc_insertion_point(imports)
-
-
-import google.protobuf.descriptor_pb2
-
-DESCRIPTOR = descriptor.FileDescriptor(
- name='plugin.proto',
- package='google.protobuf.compiler',
- serialized_pb='\n\x0cplugin.proto\x12\x18google.protobuf.compiler\x1a google/protobuf/descriptor.proto\"}\n\x14\x43odeGeneratorRequest\x12\x18\n\x10\x66ile_to_generate\x18\x01 \x03(\t\x12\x11\n\tparameter\x18\x02 \x01(\t\x12\x38\n\nproto_file\x18\x0f \x03(\x0b\x32$.google.protobuf.FileDescriptorProto\"\xaa\x01\n\x15\x43odeGeneratorResponse\x12\r\n\x05\x65rror\x18\x01 \x01(\t\x12\x42\n\x04\x66ile\x18\x0f \x03(\x0b\x32\x34.google.protobuf.compiler.CodeGeneratorResponse.File\x1a>\n\x04\x46ile\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x17\n\x0finsertion_point\x18\x02 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x0f \x01(\t')
-
-
-
-
-_CODEGENERATORREQUEST = descriptor.Descriptor(
- name='CodeGeneratorRequest',
- full_name='google.protobuf.compiler.CodeGeneratorRequest',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- descriptor.FieldDescriptor(
- name='file_to_generate', full_name='google.protobuf.compiler.CodeGeneratorRequest.file_to_generate', index=0,
- number=1, type=9, cpp_type=9, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- descriptor.FieldDescriptor(
- name='parameter', full_name='google.protobuf.compiler.CodeGeneratorRequest.parameter', index=1,
- number=2, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=unicode("", "utf-8"),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- descriptor.FieldDescriptor(
- name='proto_file', full_name='google.protobuf.compiler.CodeGeneratorRequest.proto_file', index=2,
- number=15, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- options=None,
- is_extendable=False,
- extension_ranges=[],
- serialized_start=76,
- serialized_end=201,
-)
-
-
-_CODEGENERATORRESPONSE_FILE = descriptor.Descriptor(
- name='File',
- full_name='google.protobuf.compiler.CodeGeneratorResponse.File',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- descriptor.FieldDescriptor(
- name='name', full_name='google.protobuf.compiler.CodeGeneratorResponse.File.name', index=0,
- number=1, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=unicode("", "utf-8"),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- descriptor.FieldDescriptor(
- name='insertion_point', full_name='google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point', index=1,
- number=2, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=unicode("", "utf-8"),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- descriptor.FieldDescriptor(
- name='content', full_name='google.protobuf.compiler.CodeGeneratorResponse.File.content', index=2,
- number=15, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=unicode("", "utf-8"),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- options=None,
- is_extendable=False,
- extension_ranges=[],
- serialized_start=312,
- serialized_end=374,
-)
-
-_CODEGENERATORRESPONSE = descriptor.Descriptor(
- name='CodeGeneratorResponse',
- full_name='google.protobuf.compiler.CodeGeneratorResponse',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- descriptor.FieldDescriptor(
- name='error', full_name='google.protobuf.compiler.CodeGeneratorResponse.error', index=0,
- number=1, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=unicode("", "utf-8"),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- descriptor.FieldDescriptor(
- name='file', full_name='google.protobuf.compiler.CodeGeneratorResponse.file', index=1,
- number=15, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None),
- ],
- extensions=[
- ],
- nested_types=[_CODEGENERATORRESPONSE_FILE, ],
- enum_types=[
- ],
- options=None,
- is_extendable=False,
- extension_ranges=[],
- serialized_start=204,
- serialized_end=374,
-)
-
-_CODEGENERATORREQUEST.fields_by_name['proto_file'].message_type = google.protobuf.descriptor_pb2._FILEDESCRIPTORPROTO
-_CODEGENERATORRESPONSE_FILE.containing_type = _CODEGENERATORRESPONSE;
-_CODEGENERATORRESPONSE.fields_by_name['file'].message_type = _CODEGENERATORRESPONSE_FILE
-DESCRIPTOR.message_types_by_name['CodeGeneratorRequest'] = _CODEGENERATORREQUEST
-DESCRIPTOR.message_types_by_name['CodeGeneratorResponse'] = _CODEGENERATORRESPONSE
-
-class CodeGeneratorRequest(message.Message):
- __metaclass__ = reflection.GeneratedProtocolMessageType
- DESCRIPTOR = _CODEGENERATORREQUEST
-
- # @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorRequest)
-
-class CodeGeneratorResponse(message.Message):
- __metaclass__ = reflection.GeneratedProtocolMessageType
-
- class File(message.Message):
- __metaclass__ = reflection.GeneratedProtocolMessageType
- DESCRIPTOR = _CODEGENERATORRESPONSE_FILE
-
- # @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorResponse.File)
- DESCRIPTOR = _CODEGENERATORRESPONSE
-
- # @@protoc_insertion_point(class_scope:google.protobuf.compiler.CodeGeneratorResponse)
-
-# @@protoc_insertion_point(module_scope)
diff --git a/generator/Makefile b/generator/proto/Makefile
index f2b02a9..2421175 100644
--- a/generator/Makefile
+++ b/generator/proto/Makefile
@@ -1,3 +1,5 @@
+all: nanopb_pb2.py plugin_pb2.py
+
nanopb_pb2.py: nanopb.proto
protoc --python_out=. -I /usr/include -I . nanopb.proto
diff --git a/generator/proto/__init__.py b/generator/proto/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/generator/proto/__init__.py
diff --git a/generator/nanopb.proto b/generator/proto/nanopb.proto
index 2be2f80..2be2f80 100644
--- a/generator/nanopb.proto
+++ b/generator/proto/nanopb.proto
diff --git a/generator/plugin.proto b/generator/proto/plugin.proto
index 651ed10..651ed10 100644
--- a/generator/plugin.proto
+++ b/generator/proto/plugin.proto