[tor-commits] [stem/master] Add query example to docs

atagar at torproject.org atagar at torproject.org
Tue Dec 12 20:00:23 UTC 2017


commit f5480b36cbb26a7387e6e8324a34983a6211aeda
Author: Damian Johnson <atagar at torproject.org>
Date:   Tue Dec 12 11:50:39 2017 -0800

    Add query example to docs
    
    Blogged an example of using this function when we added it...
    
      http://blog.atagar.com/august2017/
    
    Handy example to have in our docs.
---
 stem/manual.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/stem/manual.py b/stem/manual.py
index df55e3cb..c75bfce8 100644
--- a/stem/manual.py
+++ b/stem/manual.py
@@ -130,6 +130,12 @@ def query(query, *param):
   be treated as being read-only. File permissions generally enforce this, and
   in the future will be enforced by this function as well.
 
+  ::
+
+    >>> import stem.manual
+    >>> print(stem.manual.query('SELECT description FROM torrc WHERE key=?', 'CONTROLSOCKET').fetchone()[0])
+    Like ControlPort, but listens on a Unix domain socket, rather than a TCP socket.  0 disables ControlSocket (Unix and Unix-like systems only.)
+
   .. versionadded:: 1.6.0
 
   :param str query: query to run on the cache





More information about the tor-commits mailing list