aqt.profiles

Contents

aqt.profiles#

Attributes#

Classes#

VideoDriver

Create a collection of name/value pairs.

LoadMetaResult

ProfileManager

Module Contents#

class aqt.profiles.VideoDriver(*args, **kwds)#

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

    >>> Color.RED
    <Color.RED: 1>
    
  • value lookup:

    >>> Color(1)
    <Color.RED: 1>
    
  • name lookup:

    >>> Color['RED']
    <Color.RED: 1>
    

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

OpenGL = 'auto'#
ANGLE = 'angle'#
Software = 'software'#
Metal = 'metal'#
Vulkan = 'vulkan'#
Direct3D = 'd3d11'#
static default_for_platform() VideoDriver#
constrained_to_platform() VideoDriver#
next() VideoDriver#
static all_for_platform() list[VideoDriver]#
aqt.profiles.metaConf#
aqt.profiles.profileConf: dict[str, Any]#
class aqt.profiles.LoadMetaResult#
firstTime: bool#
loadError: bool#
class aqt.profiles.ProfileManager(base: pathlib.Path)#
default_answer_keys#
last_run_version: int = 0#
session: dict[str, Any]#
name: str | None = None#
db: anki.db.DB | None = None#
profile: dict | None = None#
invalid_profile_provided_on_commandline = False#
base = ''#
setupMeta() LoadMetaResult#
openProfile(profile: str) None#
profiles() list[str]#
load(name: str) bool#
save() None#
create(name: str) None#
remove(name: str) None#
trashCollection() None#
rename(name: str) None#
profileFolder(create: bool = True) str#
addonFolder() str#
backupFolder() str#
collectionPath() str#
addon_logs() str#
downgrade(profiles: list[str]) list[str]#

Downgrade all profiles. Return a list of profiles that couldn’t be opened.

static get_created_base_folder(path_override: str | None) pathlib.Path#

Create the base folder and return it, using provided path or default.

setDefaultLang(idx: int) None#
setLang(code: str) None#
video_driver() VideoDriver#
set_video_driver(driver: VideoDriver) None#
set_next_video_driver() None#
uiScale() float#
setUiScale(scale: float) None#
reduce_motion() bool#
set_reduce_motion(on: bool) None#
minimalist_mode() bool#
set_minimalist_mode(on: bool) None#
spacebar_rates_card() bool#
set_spacebar_rates_card(on: bool) None#
get_answer_key(ease: int) str | None#
set_answer_key(ease: int, key: str)#
hide_top_bar() bool#
set_hide_top_bar(on: bool) None#
top_bar_hide_mode() aqt.toolbar.HideMode#
set_top_bar_hide_mode(mode: aqt.toolbar.HideMode) None#
hide_bottom_bar() bool#
set_hide_bottom_bar(on: bool) None#
bottom_bar_hide_mode() aqt.toolbar.HideMode#
set_bottom_bar_hide_mode(mode: aqt.toolbar.HideMode) None#
last_addon_update_check() int#
set_last_addon_update_check(secs: int) None#
check_for_addon_updates() bool#
set_check_for_addon_updates(on: bool) None#
night_mode() bool#
theme() aqt.theme.Theme#
set_theme(theme: aqt.theme.Theme) None#
set_widget_style(style: aqt.theme.WidgetStyle) None#
get_widget_style() aqt.theme.WidgetStyle#
browser_layout() aqt.browser.layout.BrowserLayout#
set_browser_layout(layout: aqt.browser.layout.BrowserLayout) None#
editor_key(mode: aqt.editor.EditorMode) str#
tags_collapsed(mode: aqt.editor.EditorMode) bool#
set_tags_collapsed(mode: aqt.editor.EditorMode, collapsed: bool) None#
legacy_import_export() bool#

Always returns False so users with this option enabled are not stuck on the legacy importer after the UI option is removed.

set_legacy_import_export(enabled: bool) None#
last_loaded_profile_name() str | None#
set_last_loaded_profile_name(name: str) None#
set_sync_key(val: str | None) None#
set_sync_username(val: str | None) None#
set_host_number(val: int | None) None#
check_for_updates() bool#
set_update_check(on: bool) None#
media_syncing_enabled() bool#
auto_syncing_enabled() bool#

True if syncing on startup/shutdown enabled.

sync_auth() anki.sync.SyncAuth | None#
clear_sync_auth() None#
sync_endpoint() str | None#
set_current_sync_url(url: str | None) None#
middle_click_paste_enabled() bool#
set_middle_click_paste_enabled(val: bool) None#
custom_sync_url() str | None#

A custom server provided by the user.

set_custom_sync_url(url: str | None) None#
periodic_sync_media_minutes() int#
set_periodic_sync_media_minutes(val: int) None#
show_browser_table_tooltips() bool#
set_show_browser_table_tooltips(val: bool) None#
set_network_timeout(timeout_secs: int) None#
network_timeout() int#
set_ankihub_token(val: str | None) None#
ankihub_token() str | None#
set_ankihub_username(val: str | None) None#
ankihub_username() str | None#
allowed_url_schemes() list[str]#
set_allowed_url_schemes(schemes: list[str]) None#
always_allow_scheme(scheme: str) None#