[PyKDE] Notifying self on all emits _OR_ overriding default emit behavior

Myddrin myddrin at myddrin.com
Wed Oct 1 22:19:00 BST 2003

For the sake of argument, let's say I need to know whenever an object emits a 
signal.  Now, I can hard code each object in my program and do this:

self.I_M_ABOUT_TO_EMIT_SOMETHING(PYSIGNAL("PAH"), (snorg, do, flooo) )
emit(SIGNAL("PAH"), (snorg, do, flooo) )

But I'd really rather find some kind semi-smooth solution to the problem.

Or over load emit:
def emit(self, signal, args):
	superclass.emit(signal, args)
	self.run_signal_script(signal, args)

But that only seems to work for PYSIGNALS, and I'd like to catch the 
non-Pysginals as well.

Or, if I was using C++ QT, I could examine the info MOC slips in there and get 
the args so forth in it.  

To try and think of in terms of a webbrowser.  (and that's not the specific 
module I'm working on...just an example) If I had a couple hundred elements 
to support that I wanted to add java-script like scripting to so that the 
user could specify "run this script when this signal happens"(and users might 
create new ones, btw)...

More information about the PyQt mailing list