From: Armaan Bhojwani Date: Thu, 11 Feb 2021 21:31:28 +0000 (-0500) Subject: Remove unused variables X-Git-Tag: v0.6.0~21 X-Git-Url: https://git.armaanb.net/?p=lightcards.git;a=commitdiff_plain;h=9b01110a4cc0d2a9149e62e5a2d6c0fcce462348 Remove unused variables --- diff --git a/lightcards/display.py b/lightcards/display.py index aa121af..8f050a2 100644 --- a/lightcards/display.py +++ b/lightcards/display.py @@ -10,6 +10,14 @@ import textwrap 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 @@ -26,19 +34,12 @@ class Display: 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() - 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() @@ -61,7 +62,7 @@ class Display: 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: @@ -172,7 +173,7 @@ class Display: 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() @@ -279,7 +280,7 @@ class Display: 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()