commit 1c853f222c9d0093656c3b53832bbacf23e90acd Author: Damian Johnson atagar@torproject.org Date: Thu Oct 24 09:38:41 2013 -0700
Citing version when additions or changes to our API were made
Using sphinx's versionadded and versionchanged to note the version when our API has changed. --- stem/control.py | 7 +++++++ stem/descriptor/remote.py | 2 ++ stem/response/__init__.py | 8 ++++++++ stem/util/connection.py | 12 +++++++++++- 4 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/stem/control.py b/stem/control.py index 16f8892..1d4ecc8 100644 --- a/stem/control.py +++ b/stem/control.py @@ -739,6 +739,9 @@ class Controller(BaseController): call fails for any reason (error response, control port closed, initiated, etc).
+ .. versionchanged:: 1.1.0 + Added the get_bytes argument. + :param str,list params: GETINFO option or options to be queried :param object default: response if the query fails :param bool get_bytes: provides **bytes** values rather than a **str** under python 3.x @@ -1015,6 +1018,8 @@ class Controller(BaseController): running locally. Also, most of its checks are platform dependent, and hence are not entirely reliable.
+ .. versionadded:: 1.1.0 + :param object default: response if the query fails
:returns: str with the username tor is running as @@ -1048,6 +1053,8 @@ class Controller(BaseController): locally. Also, most of its checks are platform dependent, and hence are not entirely reliable.
+ .. versionadded:: 1.1.0 + :param object default: response if the query fails
:returns: int with our process' pid diff --git a/stem/descriptor/remote.py b/stem/descriptor/remote.py index aa4d00c..e1ebfb2 100644 --- a/stem/descriptor/remote.py +++ b/stem/descriptor/remote.py @@ -59,6 +59,8 @@ itself... |- get_key_certificates - provides present authority key certificates +- query - request an arbitrary descriptor resource
+.. versionadded:: 1.1.0 + .. data:: MAX_FINGERPRINTS
Maximum number of descriptors that can requested at a time by their diff --git a/stem/response/__init__.py b/stem/response/__init__.py index 3381573..7298abe 100644 --- a/stem/response/__init__.py +++ b/stem/response/__init__.py @@ -139,6 +139,8 @@ class ControlMessage(object): """ Provides a ControlMessage for the given content.
+ .. versionadded:: 1.1.0 + :param str content: message to construct the message from :param str msg_type: type of tor reply to parse the content as :param kwargs: optional keyword arguments to be passed to the parser method @@ -199,6 +201,9 @@ class ControlMessage(object): 2.x and **unicode** in python 3.x). The **content** however is **bytes** if **get_bytes** is **True**.
+ .. versionchanged:: 1.1.0 + Added the get_bytes argument. + :param bool get_bytes: provides **bytes** for the **content** rather than a **str**
:returns: **list** of (str, str, str) tuples for the components of this message @@ -213,6 +218,9 @@ class ControlMessage(object): """ Provides the unparsed content read from the control socket.
+ .. versionchanged:: 1.1.0 + Added the get_bytes argument. + :param bool get_bytes: if **True** then this provides **bytes** rather than a **str**
:returns: **str** of the socket data used to generate this message diff --git a/stem/util/connection.py b/stem/util/connection.py index 0b93130..d21ab0d 100644 --- a/stem/util/connection.py +++ b/stem/util/connection.py @@ -22,6 +22,8 @@ Connection and networking based utility functions.
Method for resolving a process' connections.
+ .. versionadded:: 1.1.0 + ================= =========== Resolver Description ================= =========== @@ -133,10 +135,14 @@ def get_connections(resolver, process_pid = None, process_name = None): * remote_port (int) * protocol (str, generally either 'tcp' or 'udp')
+ .. versionadded:: 1.1.0 + :param Resolver resolver: method of connection resolution to use :param int process_pid: pid of the process to retrieve :param str process_name: name of the process to retrieve
+ :returns: **list** of Connection instances + :raises: * **ValueError** if using **Resolver.PROC** or **Resolver.BSD_PROCSTAT** and the process_pid wasn't provided @@ -225,10 +231,12 @@ def get_system_resolvers(system = None): """ Provides the types of connection resolvers likely to be available on this platform.
+ .. versionadded:: 1.1.0 + :param str system: system to get resolvers for, this is determined by platform.system() if not provided
- :returns: **list** of Resolvers likely to be available on this platform + :returns: **list** of :data:`~stem.util.connection.Resolver` instances available on this platform """
if system is None: @@ -360,6 +368,8 @@ def is_private_address(address): * Private ranges: 10.*, 172.16.* - 172.31.*, 192.168.* * Loopback: 127.*
+ .. versionadded:: 1.1.0 + :param str address: string to be checked
:returns: **True** if input is in a private range, **False** otherwise
tor-commits@lists.torproject.org