From bca0d7a001f3900ddf2c7444fa3b4fe20ddc5fc4 Mon Sep 17 00:00:00 2001 From: David Culley <6276049+davidculley@users.noreply.github.com> Date: Wed, 10 Jul 2024 18:57:54 +0200 Subject: [PATCH] refactor: simplify variable assignment --- qt/aqt/editor.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index 437fadc66..65f87c26c 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -311,22 +311,12 @@ require("anki/ui").loaded.then(() => require("anki/NoteEditor").instances[0].too else: label_element = "" - if id: - idstr = f"id={id}" - else: - idstr = "" - - if toggleable: - toggleScript = "toggleEditorButton(this);" - else: - toggleScript = "" + idstr = f"id={id}" if id else "" + toggleScript = "toggleEditorButton(this);" if toggleable else "" tip = shortcut(tip) - if rightside: - class_ = "linkb" - else: - class_ = "rounded" + class_ = "linkb" if rightside else "rounded" if not disables: class_ += " perm"