[tor-commits] [sbws/master] Add doc for v3bw clasess

pastly at torproject.org pastly at torproject.org
Thu Jun 14 13:29:50 UTC 2018


commit a1931c6b92b7efa82e5c8351c60cf649e1fe2467
Author: juga0 <juga at riseup.net>
Date:   Sat May 26 18:15:58 2018 +0000

    Add doc for v3bw clasess
    
    also complete classes docstring
---
 docs/source/sbws.lib.rst |  7 +++++++
 sbws/lib/v3bwfile.py     | 40 +++++++++++++++++++++++-----------------
 2 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/docs/source/sbws.lib.rst b/docs/source/sbws.lib.rst
index d837ab3..b9a4c13 100644
--- a/docs/source/sbws.lib.rst
+++ b/docs/source/sbws.lib.rst
@@ -36,6 +36,13 @@ sbws.lib.resultdump module
     :undoc-members:
     :show-inheritance:
 
+sbws.lib.v3bwfile module
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. automodule:: sbws.lib.v3bwfile
+    :members:
+    :undoc-members:
+    :show-inheritance:
 
 Module contents
 ---------------
diff --git a/sbws/lib/v3bwfile.py b/sbws/lib/v3bwfile.py
index eef4216..cb4a6af 100644
--- a/sbws/lib/v3bwfile.py
+++ b/sbws/lib/v3bwfile.py
@@ -104,6 +104,7 @@ class V3BwHeader(object):
     :param str software: the name of the software that generates this
     :param str software_version: the version of the software
     :param dict kwargs: extra headers. Currently supported:
+
         - earliest_bandwidth: str, ISO 8601 timestamp in UTC time zone
           when the first bandwidth was obtained
         - generator_started: str, ISO 8601 timestamp in UTC time zone
@@ -231,20 +232,23 @@ class V3BwHeader(object):
 
 
 class V3BWLine(object):
+    """
+    Create a Bandwidth List line following the spec version 1.1.0.
+
+    :param str node_id:
+    :param int bw:
+    :param dict kwargs: extra headers. Currently supported:
+
+        - nickname, str
+        - master_key_ed25519, str
+        - rtt, int
+        - time, str
+        - sucess, int
+        - error_stream, int
+        - error_circ, int
+        - error_misc, int
+    """
     def __init__(self, node_id, bw, **kwargs):
-        """
-        :param str node_id:
-        :param int bw:
-        Currently accepted KeyValues:
-            - nickname, str
-            - master_key_ed25519, str
-            - rtt, int
-            - time, str
-            - sucess, int
-            - error_stream, int
-            - error_circ, int
-            - error_misc, int
-        """
         assert isinstance(node_id, str)
         assert isinstance(bw, int)
         self.node_id = node_id
@@ -335,11 +339,13 @@ class V3BWLine(object):
 
 
 class V3BwFile(object):
+    """
+    Create a Bandwidth List file following spec version 1.1.0
+
+    :param V3BWHeader v3bwheader: header
+    :param list v3bwlines: V3BWLines
+    """
     def __init__(self, v3bwheader, v3bwlines):
-        """
-        :param V3BWHeader v3bwheader:
-        :param list v3bwlines:
-        """
         self.header = v3bwheader
         self.bw_lines = v3bwlines
 





More information about the tor-commits mailing list