Main App

Contains the Main App AnkiCardGenApp.

class acg.main.AnkiCardGenApp[source]

Bases: kivymd.app.MDApp

Main App.

bind_theme_cls_and_config(self)[source]

Bind theme_cls and the corresponding ConfigParserProperties.

build(self)[source]

Set up App and return custom_widgets.MainMenu as root widget.

build_config(self, config)[source]

If no config-file exists, sets the default.

get_anki_template_dir(self)[source]

Return absolute path where html-, css- and js-files for anki-card is located.

static get_application_config()[source]

Return default path for the config.

get_current_template_db(self)[source]

Return data-base object for current_template_name.

get_word_states(self)[source]

Return dict of word-states for current template from data-base.

new_template_instance(self)[source]

Return new instance of current template class.

on_busy(self, *_)[source]

Set up busy_modal if necessary. Then open or close it depending on state of busy.

on_current_template_name(self, *_)[source]

Set up new template if current_template_name changes.

on_pause(self)[source]

Enable coming back to app.

on_start(self)[source]

Set up template on start of app.

static request_permissions()[source]

Request storage permissions on android.

class acg.main.MainMenu(**kwargs)[source]

Bases: kivy.uix.stacklayout.StackLayout

Contains everything related to the NavigationDrawer and the Screens.

get_item_text(self, screen)

Get the text of the DrawerItem corresponding to a screen.

static get_right_action_items(screen)

Return right_action_items attribute of screens root widget if present. Else return empty list.

get_screen(self, screen_name)

Return screen by name.

get_screen_names(self)

Return screen names.

on_dropdown_item(self, _, item)

Close menu and set app.current_template_name.

on_parent(self, *_)

Set up screen using name and path from screen_dicts.

The screens are added to the screen_man and corresponding entries to the drawer_list. Then DrawerList.current is bound to screen_man.current and vice-versa.

screen_dicts

ListProperty containing the dictionaries describing all screens.

set_screen(self, _=None, screen_name='')

Switch screens dynamically.

acg.main.main()[source]

Main-function.