projects
/
platform
/
upstream
/
gstreamer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
50db685
)
overrides: implement caps[i] and len(caps)
author
Alessandro Decina
<alessandro.d@gmail.com>
Mon, 15 Oct 2012 07:00:03 +0000
(09:00 +0200)
committer
Alessandro Decina
<alessandro.d@gmail.com>
Mon, 15 Oct 2012 07:29:06 +0000
(09:29 +0200)
gi/overrides/Gst.py
patch
|
blob
|
history
diff --git
a/gi/overrides/Gst.py
b/gi/overrides/Gst.py
index
510268a
..
1e3cca5
100644
(file)
--- a/
gi/overrides/Gst.py
+++ b/
gi/overrides/Gst.py
@@
-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')