[vlc-devel] commit: python-ctypes: implement iterator protocol for Log (Olivier Aubert )
git version control
git at videolan.org
Fri Jul 31 18:46:39 CEST 2009
vlc | branch: master | Olivier Aubert <olivier.aubert at liris.cnrs.fr> | Fri Jul 31 18:01:41 2009 +0200| [d49e4eb57568943c29e8d2e022e400ef23e96892] | committer: Olivier Aubert
python-ctypes: implement iterator protocol for Log
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d49e4eb57568943c29e8d2e022e400ef23e96892
---
bindings/python-ctypes/override.py | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/bindings/python-ctypes/override.py b/bindings/python-ctypes/override.py
index 382a33a..fe31c7d 100644
--- a/bindings/python-ctypes/override.py
+++ b/bindings/python-ctypes/override.py
@@ -140,3 +140,15 @@ class MediaListPlayer:
class LogIterator:
def __iter__(self):
return self
+
+ def next(self):
+ if not self.has_next():
+ raise StopIteration
+ buffer=LogMessage()
+ e=VLCException()
+ ret=libvlc_log_iterator_next(self, buffer, e)
+ return ret
+
+class Log:
+ def __iter__(self):
+ return self.get_iterator()
More information about the vlc-devel
mailing list