overrides: implement caps[i] and len(caps)

This commit is contained in:
Alessandro Decina 2012-10-15 09:00:03 +02:00
parent 50db685aef
commit 0b0202cfbe

View file

@ -66,6 +66,14 @@ class Caps(Gst.Caps):
def __str__(self):
return self.to_string()
def __getitem__(self, index):
if index >= self.get_size():
raise IndexError('structure index out of range')
return self.get_structure(index)
def __len__(self):
return self.get_size()
Caps = override(Caps)
__all__.append('Caps')