[tor-commits] [bridgedb/develop] Improve docstring for bridgedb.bridges.Bridge.assertOK().

isis at torproject.org isis at torproject.org
Thu Feb 19 02:21:15 UTC 2015


commit 6a6a1021db4a9a0b697f7243c5e7f8d233f5009f
Author: Isis Lovecruft <isis at torproject.org>
Date:   Fri Feb 13 00:43:32 2015 +0000

    Improve docstring for bridgedb.bridges.Bridge.assertOK().
    
     * FIX a typo in bridgedb.bridges.Bridge.assertOK() docstring and
       clarify the method's data validation steps.
     * ADD a TODO in the documentation for Bridge.assertOK().
---
 lib/bridgedb/bridges.py |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/bridgedb/bridges.py b/lib/bridgedb/bridges.py
index 33741a8..9a0a0ff 100644
--- a/lib/bridgedb/bridges.py
+++ b/lib/bridgedb/bridges.py
@@ -1041,9 +1041,17 @@ class Bridge(BridgeBackwardsCompatibility):
           1. Any IP addresses contained in :data:`orAddresses` are valid,
              according to :func:`~bridgedb.parse.addr.isValidIP`.
 
-          3. Any ports in :data:`orAddresses` are between ``1`` and ``65535``
+          2. Any ports in :data:`orAddresses` are between ``1`` and ``65535``
              (inclusive).
 
+          3. All IP version numbers given in :data:`orAddresses` are either
+             ``4`` or ``6``.
+
+        .. todo:: This should probably be reimplemented as a property that
+            automatically sanitises the values for each ORAddress, as is done
+            for :property:`bridgedb.bridges.BridgeAddressBase.address` and
+            :property:`bridgedb.bridges.BridgeBase.orPort`.
+
         :raises MalformedBridgeInfo: if something was found to be malformed or
             invalid.
         """





More information about the tor-commits mailing list