[Twisted-Python] Catching exception on a Serial Connection

Nestor A. Diaz nestor at tiendalinux.com
Wed Apr 29 19:09:08 EDT 2009


Hello, i am newbie to twisted, i am trying to find a way to catch 
exceptions raised from a protocol over a serial line, like the 
twisted.protocol.gps.zodiac, i see the demo script, on the twisted 
website: 
http://twistedmatrix.com/projects/core/documentation/examples/gpsfix.py 
but i don't figure yet how to handle exceptions coming from the protocol 
since i didn't figure how to register a callback for an error, cause i 
haven't found a way to create a deferred object for a serial connection.

for example, the gpsfix.py main portion is as simple as this:

    s = SerialPort(GPSTest(), o.opts['port'], reactor, baudrate=baudrate)
    reactor.run()

whereas GPSTest() is a class that inherits from protocol.Protocol, 
source code on: 
http://twistedmatrix.com/trac/browser/tags/releases/twisted-8.2.0/twisted/protocols/gps/rockwell.py

Any help would be appreciated.

thanks.

-- 
Nestor A. Diaz
Ingeniero de Sistemas
Tel. +57 1-600-5490 x 211
Cel. +57 316-227-3593
Tel. SIP: sip:211 at tiendalinux.com
Email/MSN: nestor at tiendalinux.com
http://www.tiendalinux.com/
Bogota, Colombia 





More information about the Twisted-Python mailing list