]> git.armaanb.net Git - lightcards.git/commitdiff
Remove unused variables
authorArmaan Bhojwani <me@armaanb.net>
Thu, 11 Feb 2021 21:31:28 +0000 (16:31 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Thu, 11 Feb 2021 21:31:28 +0000 (16:31 -0500)
lightcards/display.py

index aa121af67d7973d7341fecfe0e291c0916e57d24..8f050a214ae02c50717248ab1ace9835f11f6368 100644 (file)
@@ -10,6 +10,14 @@ import textwrap
 from . import runner, progress
 
 
 from . import runner, progress
 
 
+def panel_create(x, y):
+    """Create popup panels to a certain scale"""
+    win = curses.newwin(x, y)
+    panel = curses.panel.new_panel(win)
+    win.erase()
+    return (win, panel)
+
+
 class Display:
     def __init__(self, stack, headers, obj):
         self.stack = stack
 class Display:
     def __init__(self, stack, headers, obj):
         self.stack = stack
@@ -26,19 +34,12 @@ class Display:
         curses.init_pair(2, curses.COLOR_RED, -1)
         curses.init_pair(3, curses.COLOR_YELLOW, -1)
 
         curses.init_pair(2, curses.COLOR_RED, -1)
         curses.init_pair(3, curses.COLOR_YELLOW, -1)
 
-        (self.main_win, self.main_panel) = self.panel_create(mlines, mcols)
+        (self.main_win, self.main_panel) = panel_create(mlines, mcols)
         self.menu_init()
         self.help_init()
 
         self.get_key()
 
         self.menu_init()
         self.help_init()
 
         self.get_key()
 
-    def panel_create(self, x, y):
-        """Create popup panels to a certain scale"""
-        win = curses.newwin(x, y)
-        panel = curses.panel.new_panel(win)
-        win.erase()
-        return (win, panel)
-
     def panel_up(self):
         """Update panel and window contents"""
         curses.panel.update_panels()
     def panel_up(self):
         """Update panel and window contents"""
         curses.panel.update_panels()
@@ -61,7 +62,7 @@ class Display:
         Display the statusbar at the bottom of the screen with progress, star
         status, and card side.
         """
         Display the statusbar at the bottom of the screen with progress, star
         status, and card side.
         """
-        (mlines, mcols) = self.win.getmaxyx()
+        (mlines, _) = self.win.getmaxyx()
 
         # Calculate percent done
         if len(self.stack) <= 1:
 
         # Calculate percent done
         if len(self.stack) <= 1:
@@ -172,7 +173,7 @@ class Display:
 
     def menu_init(self):
         """Initialize the menu with content"""
 
     def menu_init(self):
         """Initialize the menu with content"""
-        (self.menu_win, self.menu_panel) = self.panel_create(17, 44)
+        (self.menu_win, self.menu_panel) = panel_create(17, 44)
         self.menu_panel.top()
         self.menu_panel.hide()
 
         self.menu_panel.top()
         self.menu_panel.hide()
 
@@ -279,7 +280,7 @@ class Display:
 
     def help_init(self):
         """Initialize help screen"""
 
     def help_init(self):
         """Initialize help screen"""
-        (self.help_win, self.help_panel) = self.panel_create(20, 52)
+        (self.help_win, self.help_panel) = panel_create(20, 52)
         self.help_panel.top()
         self.help_panel.hide()
         self.help_win.clear()
         self.help_panel.top()
         self.help_panel.hide()
         self.help_win.clear()