Преглед изворни кода

Fix two bugs:
One, the hrule above the footer overwrote the right border; all better now.

Two, the limit of the number of tasks was in no way reflective of the space on the display for showing the tasks. The limit is now taken from the vertical display area.

Chris Rose пре 14 година
родитељ
комит
d2595dcc95
1 измењених фајлова са 5 додато и 2 уклоњено
  1. 5 2
      celery/events/cursesmon.py

+ 5 - 2
celery/events/cursesmon.py

@@ -29,7 +29,6 @@ class CursesMonitor(object):
     selected_task = None
     selected_position = 0
     selected_str = "Selected: "
-    limit = 20
     foreground = curses.COLOR_BLACK
     background = curses.COLOR_WHITE
     online_str = "Workers online: "
@@ -96,6 +95,10 @@ class CursesMonitor(object):
         my, _ = self.win.getmaxyx()
         return my - 10
 
+    @property
+    def limit(self):
+        return self.display_height
+
     def find_position(self):
         if not self.tasks:
             return 0
@@ -335,7 +338,7 @@ class CursesMonitor(object):
 
         # -- Footer
         blank_line()
-        win.hline(my - 6, x, curses.ACS_HLINE, self.screen_width)
+        win.hline(my - 6, x, curses.ACS_HLINE, self.screen_width - 4)
 
         # Selected Task Info
         if self.selected_task: