From f037b81e069a0dcb3bdb433a983fa3b596c6bc11 Mon Sep 17 00:00:00 2001 From: MiVHQW Date: Thu, 17 Aug 2023 10:02:51 +0200 Subject: [PATCH] fixed typos; all eg -> e.g. --- src/background-ops.md | 8 ++++---- src/console-output.md | 4 ++-- src/intro.md | 2 +- src/the-anki-module.md | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/background-ops.md b/src/background-ops.md index 4f397f4..67f20ab 100644 --- a/src/background-ops.md +++ b/src/background-ops.md @@ -60,11 +60,11 @@ def my_ui_action(note_ids: list[int]): **Be careful not to directly call any Qt/UI routines inside the background operation!** -- If you need to modify the UI after an operation completes (eg show a tooltip), +- If you need to modify the UI after an operation completes (e.g.show a tooltip), you should do it from the success function. -- If the operation needs data from the UI (eg a combo box value), that data should be gathered +- If the operation needs data from the UI (e.g.a combo box value), that data should be gathered prior to executing the operation. -- If you need to update the UI during the background operation (eg to update the text of the +- If you need to update the UI during the background operation (e.g.to update the text of the progress window), your operation needs to perform that update on the main thread. For example, in a loop: @@ -84,7 +84,7 @@ if time.time() - last_progress >= 0.1: A separate `CollectionOp` is provided for undoable operations that modify the collection. It functions similarly to QueryOp, but will also update the -UI as changes are made (eg refresh the Browse screen if any notes are changed). +UI as changes are made (e.g.refresh the Browse screen if any notes are changed). Many undoable ops already have a `CollectionOp` defined in [aqt/operations/\*.py](https://github.com/ankitects/anki/tree/main/qt/aqt/operations). You can often use one of them directly rather than having to create your own. diff --git a/src/console-output.md b/src/console-output.md index da6a445..a01d148 100644 --- a/src/console-output.md +++ b/src/console-output.md @@ -1,6 +1,6 @@ # Console Output -Because Anki is a GUI app, text output to stdout (eg `print("foo")`) is not +Because Anki is a GUI app, text output to stdout (e.g.`print("foo")`) is not usually visible to the user. You can optionally reveal text printed to stdout, and it is recommended that you do so while developing your add-on. @@ -18,7 +18,7 @@ slow Anki down even if the console is not shown. ## Printing text You may find it useful to print text to stdout to aid in debugging your add-on. -Please avoid printing large amounts of text (eg in a loop that deals with hundreds or +Please avoid printing large amounts of text (e.g.in a loop that deals with hundreds or thousands of items), as that may slow Anki down, even if the console is not shown. ## Showing the Console diff --git a/src/intro.md b/src/intro.md index affa957..0f82b0a 100644 --- a/src/intro.md +++ b/src/intro.md @@ -16,7 +16,7 @@ tutorial](http://docs.python.org/tutorial/) is a good place to start. Add-ons in Anki are implemented as Python modules, which Anki loads at startup. They can register themselves to be notified when certain actions take place (eg, a hook that runs when the browse screen is loaded), and can make changes to the -UI (eg adding a new menu item) when those actions take place. +UI (e.g.adding a new menu item) when those actions take place. There is a [brief overview of Anki's architecture](https://github.com/ankitects/anki/blob/main/docs/architecture.md) diff --git a/src/the-anki-module.md b/src/the-anki-module.md index 2bc3fcd..ef983b2 100644 --- a/src/the-anki-module.md +++ b/src/the-anki-module.md @@ -145,7 +145,7 @@ Anki’s DB object supports the following functions: showInfo("card count: %d" % mw.col.db.scalar("select count() from cards")) ``` -**list() returns a list of the first column in each row, eg \[1, 2, +**list() returns a list of the first column in each row, e.g.\[1, 2, 3\]:** ```python