[tor-commits] [arm/release] fix: Remove calculateSecondLevel*() methods.

atagar at torproject.org atagar at torproject.org
Sun Jul 17 06:08:21 UTC 2011


commit f7375855453621fed4919021853bdab5ec017fd6
Author: Kamran Riaz Khan <krkhan at inspirated.com>
Date:   Tue May 31 02:38:07 2011 +0500

    fix: Remove calculateSecondLevel*() methods.
---
 src/cli/menu.py |   23 +----------------------
 1 files changed, 1 insertions(+), 22 deletions(-)

diff --git a/src/cli/menu.py b/src/cli/menu.py
index 8ce97c4..5a51797 100644
--- a/src/cli/menu.py
+++ b/src/cli/menu.py
@@ -148,27 +148,6 @@ class Menu():
 
     return (labelwidth, printable)
 
-  def _calculateSecondLevelWidths(self):
-    parent = self._getCurrentTopLevelItem()
-
-    labels = [menuItem.getLabel() for menuItem in parent.getChildren()]
-
-    labelwidth = max(map(len, labels))
-
-    return labelwidth
-
-  def _calculateSecondLevelHeights(self, height=0):
-    control = cli.controller.getController()
-    height, _ = control.getScreen().getmaxyx()
-    topSize = sum(stickyPanel.getHeight() for stickyPanel in control.getStickyPanels())
-    height = height - topSize
-
-    parent = self._getCurrentTopLevelItem()
-
-    printable = min(height - 4, parent.getChildrenCount())
-
-    return printable if printable else parent.getChildrenCount()
-
   def _calculateNLevelWidths(self, level=0):
     parent = self._getCurrentItem(level)
 
@@ -317,7 +296,7 @@ class Menu():
       self._selection[PARENTLEVEL] = 0
 
   def _moveNLevelUp(self, height):
-    printable = self._calculateSecondLevelHeights()
+    printable = self._calculateNLevelHeights(level=PARENTLEVEL)
     parent = self._getCurrentItem(level=PARENTLEVEL)
 
     if self._selection[PARENTLEVEL] > 0:





More information about the tor-commits mailing list