[SQL-CVS] r1222 - SQLObject/trunk/sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2005-11-04 08:05:28
|
Author: ianb Date: 2005-11-04 08:05:17 +0000 (Fri, 04 Nov 2005) New Revision: 1222 Modified: SQLObject/trunk/sqlobject/events.py Log: Small changes to __all__, and weak arg to listen Modified: SQLObject/trunk/sqlobject/events.py =================================================================== --- SQLObject/trunk/sqlobject/events.py 2005-11-04 05:25:25 UTC (rev 1221) +++ SQLObject/trunk/sqlobject/events.py 2005-11-04 08:05:17 UTC (rev 1222) @@ -6,7 +6,7 @@ subclassClones = {} -def listen(receiver, soClass, signal, alsoSubclasses=True): +def listen(receiver, soClass, signal, alsoSubclasses=True, weak=True): """ Listen for the given ``signal`` on the SQLObject subclass ``soClass``, calling ``receiver()`` when ``send(soClass, signal, @@ -15,7 +15,7 @@ If ``alsoSubclasses`` is true, receiver will also be called when an event is fired on any subclass. """ - dispatcher.connect(receiver, signal=signal, sender=soClass) + dispatcher.connect(receiver, signal=signal, sender=soClass, weak=weak) weakReceiver = ref(receiver) subclassClones.setdefault(soClass, []).append((weakReceiver, signal)) @@ -276,4 +276,4 @@ __all__ = ['listen', 'send'] for name, value in globals().items(): if isinstance(value, type) and issubclass(value, Signal): - __all__.append('value') + __all__.append(name) |