[tor-commits] [stem/master] Pydoc class table

atagar at torproject.org atagar at torproject.org
Sat Aug 17 20:44:27 UTC 2019


commit 587fbcf51d9a4f21db5a8ecaea3dcb094a2a4045
Author: Damian Johnson <atagar at torproject.org>
Date:   Mon Aug 5 22:15:48 2019 -0700

    Pydoc class table
---
 stem/descriptor/collector.py | 19 +++++++++++++++++--
 stem/descriptor/remote.py    |  7 +++++--
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/stem/descriptor/collector.py b/stem/descriptor/collector.py
index 57f9ce0a..04f45bad 100644
--- a/stem/descriptor/collector.py
+++ b/stem/descriptor/collector.py
@@ -16,7 +16,7 @@ With this you can either download and read directly from CollecTor...
   import datetime
   import stem.descriptor.collector
 
-  yesterday = datetime.datetime.today() - datetime.timedelta(1)
+  yesterday = datetime.datetime.utcnow() - datetime.timedelta(days = 1)
 
   # provide yesterday's exits
 
@@ -33,7 +33,7 @@ With this you can either download and read directly from CollecTor...
   import stem.descriptor
   import stem.descriptor.collector
 
-  yesterday = datetime.datetime.today() - datetime.timedelta(1)
+  yesterday = datetime.datetime.utcnow() - datetime.timedelta(days = 1)
   path = os.path.expanduser('~/descriptor_cache/server_desc_today')
 
   with open(path, 'wb') as cache_file:
@@ -46,6 +46,21 @@ With this you can either download and read directly from CollecTor...
     if desc.exit_policy.is_exiting_allowed():
       print('  %s (%s)' % (desc.nickname, desc.fingerprint))
 
+::
+
+  get_instance - Provides a singleton CollecTor used for...
+    +- get_server_descriptors - published server descriptors
+
+  File - Individual file residing within CollecTor
+    |- read - provides descriptors from this file
+    +- download - download this file to disk
+
+  CollecTor - Downloader for descriptors from CollecTor
+    |- get_server_descriptors - published server descriptors
+    |
+    |- index - metadata for content available from CollecTor
+    +- files - files available from CollecTor
+
 .. versionadded:: 1.8.0
 """
 
diff --git a/stem/descriptor/remote.py b/stem/descriptor/remote.py
index 4f29a2e5..82634513 100644
--- a/stem/descriptor/remote.py
+++ b/stem/descriptor/remote.py
@@ -48,7 +48,10 @@ content. For example...
     |- their_server_descriptor - provides the server descriptor of the relay we download from
     |- get_server_descriptors - provides present server descriptors
     |- get_extrainfo_descriptors - provides present extrainfo descriptors
-    +- get_consensus - provides the present consensus or router status entries
+    |- get_microdescriptors - provides present microdescriptors with the given digests
+    |- get_consensus - provides the present consensus or router status entries
+    |- get_bandwidth_file - provides bandwidth heuristics used to make the next consensus
+    +- get_detached_signatures - authority signatures used to make the next consensus
 
   Query - Asynchronous request to download tor descriptors
     |- start - issues the query if it isn't already running
@@ -63,7 +66,7 @@ content. For example...
     |- get_consensus - provides the present consensus or router status entries
     |- get_vote - provides an authority's vote for the next consensus
     |- get_key_certificates - provides present authority key certificates
-    |- get_bandwidth_file - provies bandwidth heuristics used to make the next consensus
+    |- get_bandwidth_file - provides bandwidth heuristics used to make the next consensus
     |- get_detached_signatures - authority signatures used to make the next consensus
     +- query - request an arbitrary descriptor resource
 





More information about the tor-commits mailing list