Skip to content

Commit

Permalink
Merge pull request #20 from MiVHQW/main
Browse files Browse the repository at this point in the history
fixed typos; all eg -> e.g.
  • Loading branch information
dae authored Aug 18, 2023
2 parents 7b48693 + f037b81 commit c2a41f1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/background-ops.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/console-output.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/the-anki-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c2a41f1

Please sign in to comment.