SF.net SVN: fclient: [29] trunk/fclient/fclient_lib/pyex/events.py
Status: Pre-Alpha
Brought to you by:
jurner
From: <jU...@us...> - 2007-11-01 14:55:44
|
Revision: 29 http://fclient.svn.sourceforge.net/fclient/?rev=29&view=rev Author: jUrner Date: 2007-11-01 07:55:49 -0700 (Thu, 01 Nov 2007) Log Message: ----------- added __contains__() method to events Modified Paths: -------------- trunk/fclient/fclient_lib/pyex/events.py Modified: trunk/fclient/fclient_lib/pyex/events.py =================================================================== --- trunk/fclient/fclient_lib/pyex/events.py 2007-11-01 14:55:22 UTC (rev 28) +++ trunk/fclient/fclient_lib/pyex/events.py 2007-11-01 14:55:49 UTC (rev 29) @@ -26,6 +26,12 @@ for o in self.observers: o(self, *args, **kwargs) + def __contains__(self, observer): + """Checks if an observer is aleady registered + @return: bool + """ + return observer in self.observers + def __iadd__(self, observer): """Adds an observer to the event @note: the observer will be called with the event as first paraeter, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |