Hello list! This is my first post, and I would like to join in the discussion :).
Laurens Van Houtven wrote: > Okay, I'll do that as soon as people have reviewed the changes > suggested in your last mail, so that I know I got it right :-) > I agree with Glyph suggestions. NMEAAdapter should delegate to a IPositionReceiver (which should be a Receiver, right? It's called Provider, maybe I'm missing something?), and avoid having to make the receiver inherit from the NMEAAdapter (which seems to be the case now, by looking at NMEAAdapter._sentence_received getattr(self, callbackName)). There will probably be tons of different GPS protocols (I sometimes work on tracking systems, and truth is many trackers don't send NMEA data but a proprietary protocol), and you don't want to have to subclass each to handle data from multiple sources. I also would refrain from using getattr tricks on the NMEA sentence classes. For me, the first line of python doc (specially on twisted!) is doing dir(obj) (and some IDEs/docgen tools actually do something like this for completion). getattr tricks and similar constructions makes it impossible to do this. It could be OK if you use getattr to handle an unknown case (for example, if you want to delegate based on whether the class has a method or not, even if in twisted interfaces world this wouldn't be the way to do, it I think), but in this case you know exactly what fields will the NMEA sentences have (and they won't change much!), so you could code them, even if this require much more code. It's the old motto of "write once maintain always" ;). You could also do other tricks, like update the class __dict__, so it would show as a regular field when the object is created, or dinamically create the class (like is done for TCPServer and friends, ugh), but really, it could be better to just write it. Thanks for the code!! :) _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python