jparyani/capnpc-python-cpp — pull request #2 by amluto (2013-08-28 22:37:33+00:00)
Title: Add more Python-visible reflection

This is probably not the most efficient thing in the world, nor is it
really beautiful, but it's fun. Now you can do this in ipython with
liberal use of the tab key:

In [2]: import capnp

In [3]: s = capnp.load('/home/luto/devel/capnp/test.capnp')

In [4]: s.
s.CxxgenArgs s.Double2D s.ExpRanges s.Exposures s.StaticState s.cxxgen s.fxgraphnode

In [4]: s.Double2D.Schema
Out[4]:

In [5]: s.Double2D.Schema.
s.Double2D.Schema.fieldnames s.Double2D.Schema.node

In [5]: s.Double2D.Schema.node
Out[5]:

In [6]: s.Double2D.Schema.node.
s.Double2D.Schema.node.annotation s.Double2D.Schema.node.id
s.Double2D.Schema.node.annotations s.Double2D.Schema.node.interface
s.Double2D.Schema.node.const s.Double2D.Schema.node.nestedNodes
s.Double2D.Schema.node.displayName s.Double2D.Schema.node.schema
s.Double2D.Schema.node.displayNamePrefixLength s.Double2D.Schema.node.scopeId
s.Double2D.Schema.node.enum s.Double2D.Schema.node.struct
s.Double2D.Schema.node.file s.Double2D.Schema.node.which

Andy Lutomirski (2):
Add some useful _StructSchema, reader, and builder methods
Expose _StructSchema's raw node

capnp/capnp.pyx | 42 ++++++++++++++++++++++++++++++++++++++++++
capnp/capnp_cpp.pxd | 14 +++++---------
2 files changed, 47 insertions(+), 9 deletions(-)