Added a load function to the capnp module

It takes .capnp file and will load it through the C++ capnproto library.
Only major thing left is initializing lists and structs in
MessageBuilder
This commit is contained in:
Jason Paryani
2013-07-06 16:53:00 -07:00
parent 08ad9e571f
commit 7b8de8bbfe
6 changed files with 179 additions and 31 deletions

View File

@@ -208,10 +208,12 @@ from types import ModuleType
{%- for node_name, node_dict in nodes.items() recursive %}
temp = {{ node_dict['full_name'] }} = ModuleType('{{ node_dict['full_name'] }}')
{%- if node_dict['body'] != 'enum' %}
{%- if node_dict['body'] == 'struct' %}
temp.Reader = {{ node_dict['full_name_cython'] }}Reader
temp.Builder = {{ node_dict['full_name_cython'] }}Builder
{%- elif node_dict['body'] == 'union' %}
temp.Reader = {{ node_dict['full_name_cython'] }}Reader
temp.Builder = {{ node_dict['full_name_cython'] }}Builder
temp.Which = {{ node_dict['full_name_cython'] }}_Which
{%- else %}
{{ node_dict['full_name'] }} = {{ node_dict['full_name_cython'] }}