Exemplo n.º 1
0
def point_version() -> int:
    from anki.buildinfo import version

    return int(version.split(".")[-1])
Exemplo n.º 2
0
from anki.buildinfo import version as ankiversion
from anki.template import TemplateRenderContext
from anki.notes import Note
import aqt
from aqt import mw, gui_hooks
from aqt.editor import Editor
from aqt.qt import QClipboard
from aqt.reviewer import Reviewer, ReviewerBottomBar
from aqt.utils import showText, tooltip

from .semieditor import semiEditorWebView
from .ankiaddonconfig import ConfigManager

ERROR_MSG = "ERROR - Edit Field During Review Cloze\n{}"

ankiver_minor = int(ankiversion.split(".")[2])
ankiver_major = ankiversion[0:3]

editorwv = semiEditorWebView()


class FldNotFoundError(Exception):
    def __init__(self, fld: str):
        self.fld = fld

    def __str__(self) -> str:
        return f"Field {self.fld} not found in note. Please check your note type."


conf = ConfigManager()