[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [bridgedb/master] Add a human-readable __str__() method to BridgeRequest classes.



commit f37c22c6284f13fb9f26f78926f0d115b468fb71
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Wed Dec 20 21:38:12 2017 +0000

    Add a human-readable __str__() method to BridgeRequest classes.
---
 bridgedb/bridgerequest.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/bridgedb/bridgerequest.py b/bridgedb/bridgerequest.py
index e555e0a..d5af05f 100644
--- a/bridgedb/bridgerequest.py
+++ b/bridgedb/bridgerequest.py
@@ -117,6 +117,15 @@ class BridgeRequestBase(object):
         self.client = 'default'
         self.valid = False
 
+    def __str__(self):
+        """Return a human-readable string describing this bridge request."""
+        return "%s(ipVersion=%d, transports=%s, notBlockedIn=%s, valid=%s)" % \
+               (self.__class__.__name__,
+                self.ipVersion,
+                self.transports,
+                self.notBlockedIn,
+                self.valid)
+
     @property
     def ipVersion(self):
         """The IP version of bridge addresses to distribute to the client.



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits