diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2009-07-10 20:10:48 +0200 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2009-07-10 20:10:48 +0200 |
commit | f8fa8e27edaf578f5ee0db32147dc5994156717d (patch) | |
tree | d67fb8ec1ba791991e90572d3b44f93ada04c7b9 | |
parent | cd67d4aeb0eb878497c9e00a5b5e5968a76200d2 (diff) | |
download | pyexiv2-f8fa8e27edaf578f5ee0db32147dc5994156717d.tar.gz |
Improved documentation.
-rw-r--r-- | src/pyexiv2.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/pyexiv2.py b/src/pyexiv2.py index 05ecffa..b9debbe 100644 --- a/src/pyexiv2.py +++ b/src/pyexiv2.py @@ -280,9 +280,11 @@ class NotifyingList(list): """ A simplistic implementation of a notifying list. - Not asynchronous. + Any changes to the list are notified in a synchronous way to all previously + registered listeners. A listener must implement the L{ListenerInterface}. """ + # Useful documentation: # file:///usr/share/doc/python2.5/html/lib/typesseq-mutable.html # http://docs.python.org/reference/datamodel.html#additional-methods-for-emulation-of-sequence-types @@ -291,9 +293,23 @@ class NotifyingList(list): self._listeners = set() def register_listener(self, listener): + """ + Register a new listener to be notified of changes. + + @param listener: any object that listens for changes + @type listener: any class that implements the L{ListenerInterface} + """ self._listeners.add(listener) def unregister_listener(self, listener): + """ + Unregister a previously registered listener. + + @param listener: a previously registered listener + @type listener: any class that implements the L{ListenerInterface} + + @raise KeyError: if the listener was not previously registered + """ self._listeners.remove(listener) def _notify_listeners(self, *args): |