Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
juga
sbws
Commits
a1931c6b
Commit
a1931c6b
authored
May 26, 2018
by
juga
Browse files
Add doc for v3bw clasess
also complete classes docstring
parent
516af314
Changes
2
Hide whitespace changes
Inline
Side-by-side
docs/source/sbws.lib.rst
View file @
a1931c6b
...
@@ -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
---------------
---------------
...
...
sbws/lib/v3bwfile.py
View file @
a1931c6b
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment