def init_dic(editor: Editor, *args, **kwargs) -> None: """ Get the last selected/default dictionary. :param editor: Anki editor window """ previous_dic = get_default_dictionary(mw) editor.dic = previous_dic
def on_dictionary_select(editor: Editor, dic: str) -> None: """ Set new default dictionary. :param editor: Anki editor window :param dic: name of selected dictionary """ set_default_dictionary(mw, dic) editor.dic = dic