commit 973e280baa6c1232bcfdd18dd993c9756c28dc33 Author: Isis Lovecruft isis@torproject.org Date: Fri Nov 15 13:30:39 2013 +0000
Add docstring to FixedBridgeSplitter.dumpAssignments(). --- lib/bridgedb/Bridges.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py index 819cdd2..4cafda0 100644 --- a/lib/bridgedb/Bridges.py +++ b/lib/bridgedb/Bridges.py @@ -867,9 +867,17 @@ class FixedBridgeSplitter(BridgeHolder): total += len(ring) return total
- def dumpAssignments(self, f, description=""): + def dumpAssignments(self, filename, description=""): + """Write all bridges assigned to this hashring to ``filename``. + + :param string description: If given, include a description next to the + index number of the ring from :attr:`FilteredBridgeHolder.rings` + the following bridges were assigned to. For example, if the + description is ``"IPv6 obfs2 bridges"`` the line would read: + ``"IPv6 obfs2 bridges ring=3"``. + """ for i,r in zip(xrange(len(self.rings)), self.rings): - r.dumpAssignments(f, "%s ring=%s" % (description, i)) + r.dumpAssignments(filename, "%s ring=%s" % (description, i))
class UnallocatedHolder(BridgeHolder): """A pseudo-bridgeholder that ignores its bridges and leaves them