Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from FooSoft:master #30

Open
wants to merge 133 commits into
base: master
Choose a base branch
from
Open

Conversation

pull[bot]
Copy link

@pull pull bot commented Apr 20, 2022

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

oakkitten added 17 commits April 7, 2022 09:48
Like Edit Current, but:
  * has a Preview button to preview all cards for this note
  * has a Browse button to open the browser with these
  * has Previous/Back buttons to navigate the history of the dialog
  * has no Close button bar
The method was failing due to Anki API changes.

Also, make it mandatory to call the method with `cardsToo=True`,
since deleting decks on Anki >= 2.1.28 without cards is
no longer supported, and the deprecated `decks.rem()` method
on Anki >= 2.1.45 ignores keyword arguments.
I think this was a typo?
This method was broken and there are no issues regarding it on GitHub.
Don't start the web server if imported not from inside Anki

Make sure Anki Connect instance is not garbage collected.
This kills the timer that's responsible for the web server.
* make previewer use a more generic Adapter to flip through cards;
* return Previewer from `show_preview()` for testing,
* as well as Edit dialog from `open_dialog_and_show_note_with_id`;
* disable/enable `Edit` editor buttons more reliably;
* a few minor changes
So that it is importable by tests
Previously, tests were run against Anki launched by user.

Now,
 * most tests run against isolated Anki in current process;
 * tests in `test_server.py` launch another Anki in a separate process
   and run a few commands to test the server;
 * nearly all tests were preserved in the sense that
   what was being tested is tested still.
   A few tests in `test_graphical.py` are skipped due to
   a problem with the method tests, see the comments;
 * tests can be run:
   * In a single profile, using --no-tear-down-profile-after-each-test;
   * In a single app instance, but with the profile being torn down
     after each test--default;
   * In separate processes, using --forked.
The tests can be run now using `tox` against multiple Anki versions;
see instructions in `tox.ini`.

The tests depend on `pytest-anki` that had to be slightly modified
to remove the upper constraint on Anki version, as well as
to remove a few dependencies that are not essential to using it.
The functionality was broken, creating a dialog that was not,
in fact, closing after adding a card.

See the deleted comment in `test_graphical.py`
It turns out that `pytest-anki` does what we are trying to do already.

Note that `empty_anki_session_started` creates a temporary user too.
We are “overwriting“ it in `profile_created_and_loaded`
by calling `temporary_user`. It seems that doing this is safe.
Before, pressing the Browse button would only show browser
with the cards or notes corresponding to the currently edited note.

Now, it shows all cards or notes from the dialog history,
in reverse order (last seen on top),
with the currently edited note or its cards selected.
Waitress is a WSGI server that Anki starts to serve css etc to
its web views. It seems to have a race condition issue;
the main loop thread is trying to `select.select` the sockets
which a worker thread is closing because of a dead connection.

This makes waitress skip actually closing the sockets.
@pull pull bot added the ⤵️ pull label Apr 20, 2022
introt and others added 9 commits April 25, 2022 20:10
* requestPermission: change Ignore button to checkbox

* Update requestPermission documentation

- describe the possible results
- document ignoreOriginList
* require Python 3.10
* prevent Anki from doing backups, again
* restore cwd that deck exporter changes for some wild reason
* Import things from `aqt.qt` not `PyQt5`/`PyQt6`
* When testing with Qt6, disable Anki's Qt5 compatibility mode
* Depend on `pytest-anki` that is also Qt version agnostic
Also add a few tests for the buttons to make sure
that they get actually added and enabled/disabled.
Consolidate Anki version checks across files
Environmental variables set in `setenv` also affect pip invocations.
`HOME` determines where pip is placing its cache.
Setting HOME to anything virtual env-specific means that
every virtual environment is created with its own cache.
This wastes time, data and disk space.
Something in Anki is setting stdout to Null.
This is a problem because Anki itself is writing to it,
particularly when printing warnings about
the deprecated methods that we are using.

This patches Anki using the same method that
the upcoming Anki 2.1.51 is using.
Fix tests and some of the code to work with Anki 2.1.50
@pull pull bot added the merge-conflict Resolve conflicts manually label Apr 27, 2022
FooSoft and others added 30 commits March 22, 2023 23:20
Added various actions relating to model templates
add `guiUndo` action for undo review
Updated Python example code to use 127.0.0.1 instead of localhost
Correct JSON MIME type (Fixes #393)
Add a method to bring up Import File dialog
The README previously sort of covered this, but in particular it was not
obvious to me that the request parameter that corresponded to enabling
`apiKey` is called `key`, and not `apiKey`, which ultimately made me
have to look at the source code to figure this out (even though the word
`key` is mentioned elsewhere on the page, it still wasn't very easy to
make the connection).

This section puts all the required information in one spot.
Make it slightly clearer how to enable authentication.
add link to Anki docs in overview
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⤵️ pull merge-conflict Resolve conflicts manually
Development

Successfully merging this pull request may close these issues.