commit b7b9ff1f214b87fc84425cb26882ec4f96362736 Author: Damian Johnson atagar@torproject.org Date: Tue Dec 27 05:20:10 2011 -0800
Reordering header pydocs so exceptions are last
The ordering of the header documentation was based on the order of things in the file. This placed exceptions at the start which isn't what readers usually want. --- stem/connection.py | 30 +++++++++++++++--------------- stem/socket.py | 10 +++++----- 2 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/stem/connection.py b/stem/connection.py index 39be31d..3758187 100644 --- a/stem/connection.py +++ b/stem/connection.py @@ -1,6 +1,21 @@ """ Functions for connecting and authenticating to the tor process.
+authenticate - Main method for authenticating to a control socket. +authenticate_none - Authenticates to an open control socket. +authenticate_password - Authenticates to a socket supporting password auth. +authenticate_cookie - Authenticates to a socket supporting cookie auth. + +get_protocolinfo - Issues a PROTOCOLINFO query. +ProtocolInfoResponse - Reply from a PROTOCOLINFO query. + |- Attributes: + | |- protocol_version + | |- tor_version + | |- auth_methods + | |- unknown_auth_methods + | +- cookie_path + +- convert - parses a ControlMessage, turning it into a ProtocolInfoResponse + AuthenticationFailure - Base exception raised for authentication failures. |- UnrecognizedAuthMethods - Authentication methods are unsupported. |- IncorrectSocketType - Socket does not speak the tor control protocol. @@ -22,21 +37,6 @@ AuthenticationFailure - Base exception raised for authentication failures. +- MissingAuthInfo - Unexpected PROTOCOLINFO response, missing auth info. |- NoAuthMethods - Missing any methods for authenticating. +- NoAuthCookie - Supports cookie auth but doesn't have its path. - -authenticate - Main method for authenticating to a control socket. -authenticate_none - Authenticates to an open control socket. -authenticate_password - Authenticates to a socket supporting password auth. -authenticate_cookie - Authenticates to a socket supporting cookie auth. - -get_protocolinfo - issues a PROTOCOLINFO query -ProtocolInfoResponse - Reply from a PROTOCOLINFO query. - |- Attributes: - | |- protocol_version - | |- tor_version - | |- auth_methods - | |- unknown_auth_methods - | +- cookie_path - +- convert - parses a ControlMessage, turning it into a ProtocolInfoResponse """
import os diff --git a/stem/socket.py b/stem/socket.py index 2dcb8ac..aa094ed 100644 --- a/stem/socket.py +++ b/stem/socket.py @@ -3,11 +3,6 @@ Supports message based communication with sockets speaking the tor control protocol. This lets users send messages as basic strings and receive responses as instances of the ControlMessage class.
-ControllerError - Base exception raised when using the controller. - |- ProtocolError - Malformed socket data. - +- SocketError - Communication with the socket failed. - +- SocketClosed - Socket has been shut down. - ControlSocket - Socket wrapper that speaks the tor control protocol. |- ControlPort - Control connection via a port. | |- get_address - provides the ip address of our socket @@ -39,6 +34,11 @@ ControlLine - String subclass with methods for parsing controller responses. send_message - Writes a message to a control socket. recv_message - Reads a ControlMessage from a control socket. send_formatting - Performs the formatting expected from sent messages. + +ControllerError - Base exception raised when using the controller. + |- ProtocolError - Malformed socket data. + +- SocketError - Communication with the socket failed. + +- SocketClosed - Socket has been shut down. """
from __future__ import absolute_import