Ticket #3802: 3802_docstring.patch

File 3802_docstring.patch, 2.7 KB (added by Lucas Taylor, 12 years ago)

SerialPort docstring

  • twisted/internet/serialport.py

     
    44
    55"""
    66Serial Port Protocol
     7
     8pySerial is required for all platforms: http://pyserial.sourceforge.net/
     9
     10Windows requires the use of a reactor that supports
     11L{twisted.internet.interfaces.IReactorWin32Events}
     12e.g. L{twisted.internet.win32eventreactor}
     13
     14pywin32 (previously win32all) is also required for Windows:
     15http://sourceforge.net/projects/pywin32/
    716"""
    817
    918# http://twistedmatrix.com/trac/ticket/3725#comment:24
     
    6372        self._serial.setRTS(on)
    6473
    6574class SerialPort(BaseSerialPort):
     75    """
     76     Initialize the SerialPort
     77     Serial parameters are passed through to the underlying
     78     pyserial Serial constructor
     79     
     80     @param protocol: Protocol to use with the serial transport
     81     @type protocol: type which implements L{IProtocol}
     82     
     83     @param deviceNameOrPortNumber: OS-specific device name or number. e.g.
     84                                    device number, starting at zero
     85                                    '/dev/ttyUSB0' on GNU/Linux
     86                                    'COM3' on Windows
     87     @type deviceNameOrPortNumber: C{str} or C{int}
     88     
     89     @param reactor: The reactor to use. On Windows, must implement
     90                    L{twisted.internet.interfaces.IReactorWin32Events}
     91                    e.g. L{twisted.internet.win32eventreactor}
     92     @type reactor: type which implements L{IReactor}.
     93
     94     @param baudrate: baudrate
     95     @type baudrate: C{int}
     96     
     97     @param bytesize: number of databits
     98     @type bytesize: C{int}
     99     
     100     @param parity: enable parity checking
     101     @type parity: C{str}
     102     
     103     @param stopbits: number of stopbits
     104     @type stopbits: C{int}
     105     
     106     @param timeout: set a read timeout value (not implemented on win32)
     107     @type timeout: C{int} or C{float}
     108     
     109     @param xonxoff: enable software flow control (0/1)
     110     @type xonxoff: C{int}
     111     
     112     @param rtscts: enable RTS/CTS flow control (0/1)
     113     @type rtscts: C{int}
     114     
     115     @raise ValueError: On Windows, if the reactor does not support
     116                        L{twisted.internet.interfaces.IReactorWin32Events}
     117                        e.g. L{twisted.internet.win32eventreactor}
     118
     119     @raise ValueError: Will be raised when serial parameters are out of range,
     120                        e.g baudrate, bytesize, etc.
     121
     122     @raise SerialException: In case the device can not be found or
     123                             can not be configured
     124     """
    66125    pass
    67126
    68127# replace SerialPort with appropriate serial port