[tor-commits] [nyx/master] Drop include_port attribute
atagar at torproject.org
atagar at torproject.org
Tue Sep 22 17:08:42 UTC 2015
commit f8477e3d842c9a57b11ec17ff3ef6e124c9b9a81
Author: Damian Johnson <atagar at torproject.org>
Date: Thu Sep 17 09:12:12 2015 -0700
Drop include_port attribute
With the simplified drawing we no longer need a class attribute for this.
---
nyx/connection_panel.py | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/nyx/connection_panel.py b/nyx/connection_panel.py
index 2d9991b..75ef0e7 100644
--- a/nyx/connection_panel.py
+++ b/nyx/connection_panel.py
@@ -191,15 +191,10 @@ class ConnectionLine(object):
Display component of the ConnectionEntry.
"""
- def __init__(self, entry, conn, include_port = True):
+ def __init__(self, entry, conn):
self._entry = entry
self.connection = conn
- # includes the port or expanded ip address field when displaying listing
- # information if true
-
- self.include_port = include_port
-
def get_listing_prefix(self):
"""
Provides a list of characters to be appended before the listing entry.
@@ -250,7 +245,7 @@ class CircHeaderLine(ConnectionLine):
self.is_built = False
self._remote_fingerprint = None
- ConnectionLine.__init__(self, entry, nyx.util.tracker.Connection(to_unix_time(circ.created), False, '127.0.0.1', 0, exit_address, exit_port, 'tcp'), include_port = False)
+ ConnectionLine.__init__(self, entry, nyx.util.tracker.Connection(to_unix_time(circ.created), False, '127.0.0.1', 0, exit_address, exit_port, 'tcp'))
self.circuit = circ
def get_fingerprint(self, default = None):
@@ -266,7 +261,7 @@ class CircLine(ConnectionLine):
def __init__(self, entry, circ, fingerprint):
relay_ip, relay_port = nyx.util.tracker.get_consensus_tracker().get_relay_address(fingerprint, ('192.168.0.1', 0))
- ConnectionLine.__init__(self, entry, nyx.util.tracker.Connection(to_unix_time(circ.created), False, '127.0.0.1', 0, relay_ip, relay_port, 'tcp'), include_port = False)
+ ConnectionLine.__init__(self, entry, nyx.util.tracker.Connection(to_unix_time(circ.created), False, '127.0.0.1', 0, relay_ip, relay_port, 'tcp'))
self._fingerprint = fingerprint
self._is_last = False
@@ -757,8 +752,9 @@ class ConnectionPanel(panel.Panel, threading.Thread):
if not isinstance(line, CircLine):
subsection_width = width - x - 19
+ include_port = not isinstance(line, CircHeaderLine)
src = tor_controller().get_info('address', line.connection.local_address)
- src += ':%s' % line.connection.local_port if line.include_port else ''
+ src += ':%s' % line.connection.local_port if include_port else ''
if isinstance(line, CircHeaderLine) and not line.is_built:
dst = 'Building...'
More information about the tor-commits
mailing list