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
The Tor Project
Anti-censorship
BridgeDB
Commits
e64e9a58
Unverified
Commit
e64e9a58
authored
Jan 12, 2014
by
Isis Lovecruft
Browse files
Add docstring for bridgedb.Bridges.BridgeRing.insert().
parent
7249c7c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/bridgedb/Bridges.py
View file @
e64e9a58
...
...
@@ -754,8 +754,19 @@ class BridgeRing(BridgeHolder):
subring
.
clear
()
def
insert
(
self
,
bridge
):
"""Add a bridge to the ring. If the bridge is already there,
replace the old one."""
"""Add a **bridge** to this hashring.
The bridge's position in the hashring is dependent upon the HMAC of
the raw hash digest of the bridge's ID key. The function used to
generate the HMAC, :ivar:`BridgeRing.hmac`, is unique to each
individual hashring.
If the (presumably same) bridge is already at that determined position
in this hashring, replace the old one.
:type bridge: :class:`~bridgedb.Bridges.Bridge`
:param bridge: The bridge to insert into this hashring.
"""
for
tp
,
val
,
_
,
subring
in
self
.
subrings
:
if
tp
==
'port'
:
if
val
==
bridge
.
orport
:
...
...
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