Commit a1931c6b authored by juga's avatar juga
Browse files

Add doc for v3bw clasess

also complete classes docstring
parent 516af314
...@@ -36,6 +36,13 @@ sbws.lib.resultdump module ...@@ -36,6 +36,13 @@ sbws.lib.resultdump module
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
sbws.lib.v3bwfile module
~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: sbws.lib.v3bwfile
:members:
:undoc-members:
:show-inheritance:
Module contents Module contents
--------------- ---------------
......
...@@ -104,6 +104,7 @@ class V3BwHeader(object): ...@@ -104,6 +104,7 @@ class V3BwHeader(object):
:param str software: the name of the software that generates this :param str software: the name of the software that generates this
:param str software_version: the version of the software :param str software_version: the version of the software
:param dict kwargs: extra headers. Currently supported: :param dict kwargs: extra headers. Currently supported:
- earliest_bandwidth: str, ISO 8601 timestamp in UTC time zone - earliest_bandwidth: str, ISO 8601 timestamp in UTC time zone
when the first bandwidth was obtained when the first bandwidth was obtained
- generator_started: str, ISO 8601 timestamp in UTC time zone - generator_started: str, ISO 8601 timestamp in UTC time zone
...@@ -231,20 +232,23 @@ class V3BwHeader(object): ...@@ -231,20 +232,23 @@ class V3BwHeader(object):
class V3BWLine(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): 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(node_id, str)
assert isinstance(bw, int) assert isinstance(bw, int)
self.node_id = node_id self.node_id = node_id
...@@ -335,11 +339,13 @@ class V3BWLine(object): ...@@ -335,11 +339,13 @@ class V3BWLine(object):
class V3BwFile(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): def __init__(self, v3bwheader, v3bwlines):
"""
:param V3BWHeader v3bwheader:
:param list v3bwlines:
"""
self.header = v3bwheader self.header = v3bwheader
self.bw_lines = v3bwlines self.bw_lines = v3bwlines
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment