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

[tor-commits] [nyx/master] Inbound connections could be misaligned



commit 53eb54fad3da89b19cd457b7e0e65317575747da
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Fri Nov 3 19:07:31 2017 -0700

    Inbound connections could be misaligned
    
    We padded the source and destination with different sizes to account for
    listing a locale, but that padding was inverted for inbound connections.
---
 nyx/panel/connection.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/nyx/panel/connection.py b/nyx/panel/connection.py
index 13983b1..a1e5916 100644
--- a/nyx/panel/connection.py
+++ b/nyx/panel/connection.py
@@ -635,13 +635,16 @@ def _draw_address_column(subwindow, x, y, line, attr):
     elif not tor_controller().is_geoip_unavailable() and not line.entry.is_private():
       dst += ' (%s)' % (line.locale if line.locale else '??')
 
+  src = '%-21s' % src
+  dst = '%-26s' % dst
+
   if line.entry.get_type() in (Category.INBOUND, Category.SOCKS, Category.CONTROL):
     dst, src = src, dst
 
   if line.line_type == LineType.CIRCUIT:
     return subwindow.addstr(x, y, dst, *attr)
   else:
-    return subwindow.addstr(x, y, '%-21s  -->  %-26s' % (src, dst), *attr)
+    return subwindow.addstr(x, y, '%s  -->  %s' % (src, dst), *attr)
 
 
 def _draw_details(subwindow, selected):



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