Unverified Commit f5adabe5 authored by Isis Lovecruft's avatar Isis Lovecruft
Browse files

Refactor PluggableTransport.getTransportLine() to remove `keyid=`.

 * FIXES #10559
 * FIXES a bunch of PEP8 problems.
 * CHANGE getTransportLine() to use `' '.join()` rather than formatting the
   bridge line inside the return statement. It's faster and safer.
parent ff4e39ed
......@@ -413,14 +413,23 @@ class PluggableTransport:
:returns: A configuration line for adding this pluggable transport
into a torrc file.
"""
if isinstance(self.address,ipaddr.IPv6Address):
address = "[%s]" % self.address
else: address = self.address
host = "%s %s:%d" % (self.methodname, address, self.port)
fp = ''
if includeFingerprint: fp = "keyid=%s" % self.bridge.fingerprint
args = ",".join(["%s=%s"%(k,v) for k,v in self.argdict.items()]).strip()
return "%s %s %s" % (host, fp, args)
sections = []
if isinstance(self.address, ipaddr.IPv6Address):
host = "%s [%s]:%d" % (self.methodname, self.address, self.port)
else:
host = "%s %s:%d" % (self.methodname, self.address, self.port)
sections.append(host)
if includeFingerprint:
sections.append(self.bridge.fingerprint)
args = ",".join(["%s=%s" % (k, v) for k, v in self.argdict.items()])
sections.append(args)
line = ' '.join(sections)
return line
def parseExtraInfoFile(f):
"""
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment