From: Mike C. F. <mcf...@ro...> - 2004-04-07 16:11:41
|
Schoenborn, Oliver wrote: ... >When >the user changes something in the view, say data in a text control box, the >view commits the data to a leaf in the hierarchy of the document and >generates a message for '(doc, changed, fromView)' topic, in case 'someone' >is interested in the fact that document has been changed. Similarly, the >import reader generates a message for topic '(doc, changed, fromImport)' >when it imports some external data into some leaves of an existing document. > > Okay, so the approach I outlined should work with PyDispatcher. I'll put it on the (seemingly infinitely long) list of things to play with some day. Basically it would look something like this: def sendHier( signal=Any, sender=Anonymous, *arguments, **named ): if isinstance( signal, HierMessage ): responses = [] while signal: responses.extend(sendExact( signal, sender, *arguments, **named )) signal = signal[:-1] responses.extend( sendExact( Any, sender, *arguments, **named )) return responses else: return send( signal, sender, *arguments, **named ) I'd have to take some time to write up test cases and check that the last sendExact would do the proper thing, but I think that basically gives all the features you've described. Have fun, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |