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

[tor-commits] [bridgedb/develop] Change Bridge.__str__() to identify bridges as the ControlPort does.



commit 928ca525105146657c0f6addadd56332fefad85d
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Wed Dec 24 08:56:09 2014 +0000

    Change Bridge.__str__() to identify bridges as the ControlPort does.
---
 lib/bridgedb/bridges.py |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/bridgedb/bridges.py b/lib/bridgedb/bridges.py
index f612565..71afe3b 100644
--- a/lib/bridgedb/bridges.py
+++ b/lib/bridgedb/bridges.py
@@ -799,18 +799,19 @@ class Bridge(BridgeBackwardsCompatibility):
             :data:`nickname```.$``:data:`fingerprint`.
         """
         nickname = self.nickname if self.nickname else 'Unnamed'
-        separator = '.$'
+        prefix = '$'
+        separator = "~"
         fingerprint = self.fingerprint
 
         if safelog.safe_logging:
-            separator = '.$$'
+            prefix = '$$'
             if fingerprint:
-                fingerprint = hashlib.sha1(fingerprint).hexdigest()
+                fingerprint = hashlib.sha1(fingerprint).hexdigest().upper()
 
         if not fingerprint:
             fingerprint = '0' * 40
 
-        return nickname + separator + fingerprint
+        return prefix + fingerprint + separator + nickname
 
     def _checkServerDescriptor(self, descriptor):
         # If we're parsing the server-descriptor, require a networkstatus



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