From 238f8b2c2f0b2aee853b458d5ff5b77d01c22929 Mon Sep 17 00:00:00 2001 From: Jason Paryani Date: Wed, 13 Nov 2013 12:02:43 -0800 Subject: [PATCH] Add get_dependency to all Schema classes --- capnp/capnp.pyx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/capnp/capnp.pyx b/capnp/capnp.pyx index 19af3fa..d1e2ba8 100644 --- a/capnp/capnp.pyx +++ b/capnp/capnp.pyx @@ -1469,6 +1469,9 @@ cdef class _StructSchema: def __get__(self): return _DynamicStructReader()._init(self.thisptr.getProto(), None) + cpdef get_dependency(self, id): + return _Schema()._init(self.thisptr.getDependency(id)) + def __richcmp__(_StructSchema self, _StructSchema other, mode): if mode == 2: return self.thisptr == other.thisptr @@ -1504,6 +1507,9 @@ cdef class _InterfaceSchema: def __get__(self): return _DynamicStructReader()._init(self.thisptr.getProto(), None) + cpdef get_dependency(self, id): + return _Schema()._init(self.thisptr.getDependency(id)) + def __repr__(self): return '' % self.node.displayName