diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2014-02-24 17:19:38 -0800 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2014-02-24 17:19:38 -0800 |
commit | a00316af157a8b798b47b8ab1336d5b1a878d3ed (patch) | |
tree | a6699fed58e517545ba2a1afaa914bda597430ac | |
parent | e2ac82c47c0e70426f3be4329f20bd3b500078bb (diff) |
Format init
-rw-r--r-- | paramiko/transport.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/paramiko/transport.py b/paramiko/transport.py index 612dfc28..dc493746 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -127,30 +127,30 @@ class Transport (threading.Thread): def __init__(self, sock): """ Create a new SSH session over an existing socket, or socket-like - object. This only creates the Transport object; it doesn't begin the + object. This only creates the `.Transport` object; it doesn't begin the SSH session yet. Use `connect` or `start_client` to begin a client session, or `start_server` to begin a server session. If the object is not actually a socket, it must have the following methods: - - ``send(str)``: Writes from 1 to ``len(str)`` bytes, and - returns an int representing the number of bytes written. Returns - 0 or raises ``EOFError`` if the stream has been closed. - - ``recv(int)``: Reads from 1 to ``int`` bytes and returns them as a - string. Returns 0 or raises ``EOFError`` if the stream has been - closed. - - ``close()``: Closes the socket. - - ``settimeout(n)``: Sets a (float) timeout on I/O operations. + + - ``send(str)``: Writes from 1 to ``len(str)`` bytes, and returns an + int representing the number of bytes written. Returns + 0 or raises ``EOFError`` if the stream has been closed. + - ``recv(int)``: Reads from 1 to ``int`` bytes and returns them as a + string. Returns 0 or raises ``EOFError`` if the stream has been + closed. + - ``close()``: Closes the socket. + - ``settimeout(n)``: Sets a (float) timeout on I/O operations. For ease of use, you may also pass in an address (as a tuple) or a host string as the ``sock`` argument. (A host string is a hostname with an optional port (separated by ``":"``) which will be converted into a tuple of ``(hostname, port)``.) A socket will be connected to this - address and used for communication. Exceptions from the ``socket`` call - may be thrown in this case. + address and used for communication. Exceptions from the ``socket`` + call may be thrown in this case. - :param sock: a socket or socket-like object to create the session over. - :type sock: socket + :param socket sock: a socket or socket-like object to create the session over. """ if isinstance(sock, (str, unicode)): # convert "host:port" into (host, port) |