[tor-commits] [nyx/master] Drop internal reset_display() methods

atagar at torproject.org atagar at torproject.org
Tue Sep 22 17:08:40 UTC 2015


commit 8f473b63f31ba100edc11a40d8f5efcb3ebc4cd1
Author: Damian Johnson <atagar at torproject.org>
Date:   Sun Jul 26 11:14:42 2015 -0700

    Drop internal reset_display() methods
    
    Seems to be leftovers from our attempt to do in-place modifications. The
    ConnectionPanelEntry's method was completely unused, and the
    ConnectionPanelLine's invoked whenever we got lines but doesn't look to be
    important (flushes a few caches, which think we now want to keep).
---
 nyx/connections/conn_entry.py |    4 ----
 nyx/connections/entries.py    |   29 -----------------------------
 2 files changed, 33 deletions(-)

diff --git a/nyx/connections/conn_entry.py b/nyx/connections/conn_entry.py
index e9f9297..42466d9 100644
--- a/nyx/connections/conn_entry.py
+++ b/nyx/connections/conn_entry.py
@@ -243,10 +243,6 @@ class ConnectionLine(entries.ConnectionPanelLine):
     detail_format = (curses.A_BOLD, CATEGORY_COLOR[self.get_type()])
     return [(line, detail_format) for line in self._get_detail_content(width)]
 
-  def reset_display(self):
-    entries.ConnectionPanelLine.reset_display(self)
-    self.cached_type = None
-
   def is_private(self):
     """
     Returns true if the endpoint is private, possibly belonging to a client
diff --git a/nyx/connections/entries.py b/nyx/connections/entries.py
index c4db1ea..fa4e71f 100644
--- a/nyx/connections/entries.py
+++ b/nyx/connections/entries.py
@@ -41,9 +41,7 @@ def to_unix_time(dt):
 class ConnectionPanelEntry:
   def __init__(self, start_time):
     self.lines = []
-    self.flush_cache = True
     self.start_time = start_time
-    self.lines = []
 
   @staticmethod
   def from_connection(conn):
@@ -90,20 +88,8 @@ class ConnectionPanelEntry:
     Provides the individual lines in the connection listing.
     """
 
-    if self.flush_cache:
-      self.lines = self._get_lines(self.lines)
-      self.flush_cache = False
-
     return self.lines
 
-  def _get_lines(self, old_results):
-    # implementation of get_lines
-
-    for line in old_results:
-      line.reset_display()
-
-    return old_results
-
   def get_sort_values(self, sort_attrs, listing_type):
     """
     Provides the value used in comparisons to sort based on the given
@@ -163,13 +149,6 @@ class ConnectionPanelEntry:
     else:
       return ''
 
-  def reset_display(self):
-    """
-    Flushes cached display results.
-    """
-
-    self.flush_cache = True
-
 
 class ConnectionPanelLine:
   """
@@ -235,11 +214,3 @@ class ConnectionPanelLine:
   def _get_details(self, width):
     # implementation of get_details
     return []
-
-  def reset_display(self):
-    """
-    Flushes cached display results.
-    """
-
-    self._listing_cache_args = (None, None)
-    self._details_cache_args = None





More information about the tor-commits mailing list