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

[tor-commits] [bridgedb/master] Make the 'Bridge ' prefix optional in PluggableTransport.getTransportLine().



commit 4476867c0747b3ee884c296b2c8bef16ae8b18b1
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Sun Jan 12 02:45:38 2014 +0000

    Make the 'Bridge ' prefix optional in PluggableTransport.getTransportLine().
---
 lib/bridgedb/Bridges.py |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py
index cbc86f9..67fa963 100644
--- a/lib/bridgedb/Bridges.py
+++ b/lib/bridgedb/Bridges.py
@@ -398,7 +398,7 @@ class PluggableTransport:
             self.argdict = argdict
         else: self.argdict = {}
 
-    def getTransportLine(self, includeFingerprint=False):
+    def getTransportLine(self, includeFingerprint=False, bridgePrefix=False):
         """Get a torrc line for this pluggable transport.
 
         This method does not return lines which are prefixed with the word
@@ -409,12 +409,17 @@ class PluggableTransport:
 
         :param bool includeFingerprints: If ``True``, include the digest of
             this bridges public identity key in the torrc line.
+        :param bool bridgePrefix: If ``True``, add ``'Bridge '`` to the
+             beginning of each returned line (suitable for pasting directly
+             into a torrc file).
         :rtype: str
         :returns: A configuration line for adding this pluggable transport
             into a torrc file.
         """
         sections = []
 
+        if bridgePrefix:
+            sections.append('Bridge')
 
         if isinstance(self.address, ipaddr.IPv6Address):
             host = "%s [%s]:%d" % (self.methodname, self.address, self.port)



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