Add get_dependency to all Schema classes

This commit is contained in:
Jason Paryani
2013-11-13 12:02:43 -08:00
parent 11543b7abf
commit 238f8b2c2f

View File

@@ -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 '<schema for %s>' % self.node.displayName