From bdcd111d727949633a1dbbf8dd99d803c987fcec Mon Sep 17 00:00:00 2001 From: Arthur Milchior Date: Wed, 19 Feb 2020 02:16:02 -0800 Subject: [PATCH] Replace g[idx] by variable name --- qt/aqt/browser.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/qt/aqt/browser.py b/qt/aqt/browser.py index 7eed68596..817791452 100644 --- a/qt/aqt/browser.py +++ b/qt/aqt/browser.py @@ -1157,16 +1157,19 @@ by clicking on one on the left.""" def fillGroups(root, grps, head=""): for g in grps: + baseName = g[0] + did = g[1] + children = g[5] item = SidebarItem( - g[0], + baseName, ":/icons/deck.svg", - lambda g=g: self.setFilter("deck", head + g[0]), - lambda expanded, g=g: self.mw.col.decks.collapseBrowser(g[1]), + lambda baseName=baseName: self.setFilter("deck", head + baseName), + lambda expanded, did=did: self.mw.col.decks.collapseBrowser(did), not self.mw.col.decks.get(g[1]).get("browserCollapsed", False), ) root.addChild(item) - newhead = head + g[0] + "::" - fillGroups(item, g[5], newhead) + newhead = head + baseName + "::" + fillGroups(item, children, newhead) fillGroups(root, grps)