aqt#

Submodules#

Attributes#

Classes#

Functions#

setupLangAndBackend(→ anki._backend.RustBackend)

parseArgs(→ tuple[argparse.Namespace, list[str]])

Returns (opts, args).

setupGL(→ None)

write_profile_results(→ None)

run(→ None)

Package Contents#

aqt.appVersion#
aqt.appWebsite = 'https://apps.ankiweb.net/'#
aqt.appWebsiteDownloadSection = 'https://apps.ankiweb.net/#download'#
aqt.appDonate = 'https://docs.ankiweb.net/contrib.html'#
aqt.appShared = 'https://ankiweb.net/shared/'#
aqt.appUpdate = 'https://ankiweb.net/update/desktop'#
aqt.appHelpSite = 'https://docs.ankiweb.net/'#
aqt.profiler: cProfile.Profile | None = None#
aqt.mw: main.AnkiQt = None#
class aqt.DialogManager#
open(name: str, *args: Any, **kwargs: Any) Any#
markClosed(name: str) None#
allClosed() bool#
closeAll(onsuccess: collections.abc.Callable[[], None]) bool | None#
register_dialog(name: str, creator: collections.abc.Callable | type, instance: Any | None = None) None#

Allows add-ons to register a custom dialog to be managed by Anki’s dialog manager, which ensures that only one copy of the window is open at once, and that the dialog cleans up asynchronously when the collection closes

Please note that dialogs added in this manner need to define a close behavior by either:

  • setting dialog.silentlyClose = True to have it close immediately

  • define a dialog.closeWithCallback() method that is called when closed by the dialog manager

TODO?: Implement more restrictive type check to ensure these requirements are met

Arguments:

name {str} – Name/identifier of the dialog in question creator {Union[Callable, type]} – A class or function to create new

dialog instances with

Keyword Arguments:
instance {Optional[Any]} – An optional existing instance of the dialog

(default: {None})

aqt.dialogs#
aqt.setupLangAndBackend(pm: profiles.ProfileManager, app: QApplication, force: str | None = None, firstTime: bool = False) anki._backend.RustBackend#
class aqt.NativeEventFilter#

Bases: QAbstractNativeEventFilter

nativeEventFilter(eventType: Any, message: Any) tuple[bool, Any | None]#
class aqt.AnkiApp(argv: list[str])#

Bases: QApplication

appMsg#
KEY = 'anki'#
TMOUT = 30000#
secondInstance() bool#
sendMsg(txt: str) bool#
onRecv() None#
event(evt: QEvent | None) bool#
eventFilter(src: Any, evt: QEvent | None) bool#
aqt.parseArgs(argv: list[str]) tuple[argparse.Namespace, list[str]]#

Returns (opts, args).

aqt.setupGL(pm: profiles.ProfileManager) None#
aqt.PROFILE_CODE#
aqt.write_profile_results() None#
aqt.run() None#