commit c01f50f51adfb12969d3d76b265c8b81f7ef2bc2 Author: Damian Johnson atagar@torproject.org Date: Mon Jan 1 13:37:09 2018 -0800
Stub initial Relay class
Still feeling out the direction we'll go, but I suspect we're gonna have a Relay class providing high level methods the same way as our Controller does. --- stem/client.py | 24 ++++++++++++++++++++++++ stem/socket.py | 4 +++- 2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/stem/client.py b/stem/client.py new file mode 100644 index 00000000..e1011f96 --- /dev/null +++ b/stem/client.py @@ -0,0 +1,24 @@ +# Copyright 2018, Damian Johnson and The Tor Project +# See LICENSE for licensing information + +""" +Module for interacting with the ORPort provided by Tor relays. The +:class:`~stem.client.Relay` is a wrapper for :class:`~stem.socket.RelaySocket`, +providing higher level functions in much the same way as our +:class:`~stem.control.Controller` wraps :class:`~stem.socket.ControlSocket`. + +.. versionadded:: 1.7.0 + +**Module Overview:** + +:: + + Relay - Connection with a relay's ORPort. +""" + + +class Relay(object): + """ + Connection with a `Tor relay's ORPort + https://gitweb.torproject.org/torspec.git/tree/tor-spec.txt`_. + """ diff --git a/stem/socket.py b/stem/socket.py index fe902f0a..7a2ec9de 100644 --- a/stem/socket.py +++ b/stem/socket.py @@ -2,7 +2,7 @@ # See LICENSE for licensing information
""" -Supports communication with sockets speaking the Tor control protocol. This +Supports communication with sockets speaking Tor protocols. This allows us to send messages as basic strings, and receive responses as :class:`~stem.response.ControlMessage` instances.
@@ -351,6 +351,8 @@ class RelaySocket(BaseSocket): https://gitweb.torproject.org/torspec.git/tree/tor-spec.txt`_ to a Tor relay.
+ .. versionadded:: 1.7.0 + :var str address: address our socket connects to :var int port: ORPort our socket connects to """