diff --git a/qt/aqt/browser.py b/qt/aqt/browser.py index 5084b9213..c6f8d09b0 100644 --- a/qt/aqt/browser.py +++ b/qt/aqt/browser.py @@ -39,7 +39,7 @@ from aqt.scheduling_ops import ( from aqt.sidebar import SidebarTreeView from aqt.switch import Switch from aqt.table import Table -from aqt.tag_ops import add_tags, clear_unused_tags, remove_tags_for_notes +from aqt.tag_ops import add_tags_to_notes, clear_unused_tags, remove_tags_from_notes from aqt.utils import ( HelpPage, KeyboardModifiersPressed, @@ -682,7 +682,7 @@ where id in %s""" "Shows prompt if tags not provided." if not (tags := tags or self._prompt_for_tags(tr.browsing_enter_tags_to_add())): return - add_tags( + add_tags_to_notes( mw=self.mw, note_ids=self.selected_notes(), space_separated_tags=tags, @@ -698,7 +698,7 @@ where id in %s""" tags := tags or self._prompt_for_tags(tr.browsing_enter_tags_to_delete()) ): return - remove_tags_for_notes( + remove_tags_from_notes( mw=self.mw, note_ids=self.selected_notes(), space_separated_tags=tags, diff --git a/qt/aqt/reviewer.py b/qt/aqt/reviewer.py index f00ea451e..f23f2669c 100644 --- a/qt/aqt/reviewer.py +++ b/qt/aqt/reviewer.py @@ -30,7 +30,7 @@ from aqt.scheduling_ops import ( suspend_note, ) from aqt.sound import av_player, play_clicked_audio, record_audio -from aqt.tag_ops import add_tags, remove_tags_for_notes +from aqt.tag_ops import add_tags_to_notes, remove_tags_from_notes from aqt.theme import theme_manager from aqt.toolbar import BottomBar from aqt.utils import askUserDialog, downArrow, qtMenuShortcutWorkaround, tooltip, tr @@ -841,11 +841,13 @@ time = %(time)d; def toggle_mark_on_current_note(self) -> None: note = self.card.note() if note.has_tag(MARKED_TAG): - remove_tags_for_notes( + remove_tags_from_notes( mw=self.mw, note_ids=[note.id], space_separated_tags=MARKED_TAG ) else: - add_tags(mw=self.mw, note_ids=[note.id], space_separated_tags=MARKED_TAG) + add_tags_to_notes( + mw=self.mw, note_ids=[note.id], space_separated_tags=MARKED_TAG + ) def on_set_due(self) -> None: if self.mw.state != "review" or not self.card: diff --git a/qt/aqt/sidebar.py b/qt/aqt/sidebar.py index 7da0ff161..12f49084b 100644 --- a/qt/aqt/sidebar.py +++ b/qt/aqt/sidebar.py @@ -18,7 +18,7 @@ from aqt.clayout import CardLayout from aqt.deck_ops import remove_decks, rename_deck, reparent_decks from aqt.models import Models from aqt.qt import * -from aqt.tag_ops import remove_tags_for_all_notes, rename_tag, reparent_tags +from aqt.tag_ops import remove_tags_from_all_notes, rename_tag, reparent_tags from aqt.theme import ColoredIcon, theme_manager from aqt.utils import KeyboardModifiersPressed, askUser, getOnlyText, showWarning, tr @@ -1175,7 +1175,7 @@ class SidebarTreeView(QTreeView): tags = self.mw.col.tags.join(self._selected_tags()) item.name = "..." - remove_tags_for_all_notes( + remove_tags_from_all_notes( mw=self.mw, parent=self.browser, space_separated_tags=tags ) diff --git a/qt/aqt/tag_ops.py b/qt/aqt/tag_ops.py index bfc81bd0c..5ce7fdf18 100644 --- a/qt/aqt/tag_ops.py +++ b/qt/aqt/tag_ops.py @@ -12,7 +12,7 @@ from aqt.main import PerformOpOptionalSuccessCallback from aqt.utils import showInfo, tooltip, tr -def add_tags( +def add_tags_to_notes( *, mw: AnkiQt, note_ids: Sequence[NoteId], @@ -24,7 +24,7 @@ def add_tags( ) -def remove_tags_for_notes( +def remove_tags_from_notes( *, mw: AnkiQt, note_ids: Sequence[NoteId], @@ -66,7 +66,7 @@ def rename_tag( ) -def remove_tags_for_all_notes( +def remove_tags_from_all_notes( *, mw: AnkiQt, parent: QWidget, space_separated_tags: str ) -> None: mw.perform_op(