Commit Graph

790 Commits

Author SHA1 Message Date
Damien Elmes
db3308e788 add linux_arm64 platform 2020-12-29 18:40:39 +10:00
Damien Elmes
a1498e9e81
Merge pull request #866 from guillem-palau-salva/master
Update consts.py
2020-12-29 10:15:42 +10:00
Damien Elmes
cb93a0909c
Merge pull request #872 from RumovZ/fix-deck-check
Fix deck check and thus blue sync arrow bug
2020-12-29 10:11:59 +10:00
RumovZ
9f18e12cb8 Fix deck check and thus blue snyc arrow bug
Cast col.decks.selected() to int so the return type fits the annotation.
Thus, fix the comparison in col.decks.select() which was leading to
a superfluous db modification and in turn to a false indication of a
necessary sync right after another one in certain cases.
2020-12-29 00:29:36 +01:00
Guillem Palau-Salvà
870df16b01 Update consts.py
I notices that type 4 is added in the revlog when rescheduling. Reviews are logged as 0 time and type 4.
2020-12-27 01:02:32 +01:00
Damien Elmes
c4382e38a1 update to stable pyo3 0.13 release 2020-12-23 10:08:38 +10:00
Damien Elmes
212b251334 tag the wheels as manual so test ... doesn't build them 2020-12-21 19:28:47 +10:00
Damien Elmes
73679b03e7 possible fix for sync button colour blue after sync
If the client's clock is behind AnkiWeb's, even by a few seconds,
we can end up with a situation where last_begin_at is updated after
the sync to a value less than the mtime we received from AnkiWeb,
causing the collection to be saved, which bumps the modtime.

Work around this by recording mtime at begin() time, and seeing if it
has changed in either direction.

Thanks to Rumo, who did the hard work looking into it:
https://forums.ankiweb.net/t/why-is-my-sync-button-blue/2078/21
2020-12-21 19:27:26 +10:00
Damien Elmes
e99a7c0f90 tweak naming and move method into col.decks 2020-12-20 10:26:16 +10:00
k12ish
cc0572a385 Added type hints, renamed kwarg 2020-12-19 18:12:58 +00:00
k12ish
ef1f58c8b6 Added method 2020-12-19 17:59:07 +00:00
Damien Elmes
af92bb5e93 exhaustiveness checks on literals are now possible with the move to py38 2020-12-18 16:50:55 +10:00
Damien Elmes
ecb7c1482f use QtMultimedia for recording instead of PyAudio
The unmute-on-first-duration-change approach is to try to prevent
clicks/pops that can happen at the start of recordings. If it doesn't
solve the problem, we may need to drop down to the lower-level
QAudioInput().

Closes https://github.com/ankitects/help-wanted/issues/23

May fix https://forums.ankiweb.net/t/anki-crashes-periodically-after-clicking-record-audio-button/5824,
which I suspect was caused by processEvents()
2020-12-16 19:33:25 +10:00
Damien Elmes
a61f3bbc48 fix some warnings on startup 2020-12-16 15:38:24 +10:00
Damien Elmes
c8f989239b remove conditional rsbackend_gen import
It causes PyCharm to think methods are missing on col.backend, and
should not be needed with the move to Bazel.
2020-12-16 13:30:54 +10:00
Damien Elmes
937247ab06 add type stub for _rsbridge to make PyCharm happy 2020-12-16 13:13:42 +10:00
Damien Elmes
53276b3044 symlink generated .py/.pyi into tree to fix Python code completion 2020-12-16 11:36:42 +10:00
Damien Elmes
1b98e7e48f add ability to specify an individual Python test 2020-12-16 10:40:29 +10:00
Damien Elmes
1da327c725 minor doc updates 2020-12-11 22:37:12 +10:00
Damien Elmes
13d66b22f4 remove unwanted leading '/' in wheel records 2020-12-10 23:02:18 +10:00
Damien Elmes
0cbb60169c simplify wheel building 2020-12-10 20:27:21 +10:00
Damien Elmes
85b7e1c623 drop unused i686 references
https://forums.ankiweb.net/t/changing-ankis-build-system-to-bazel/4737/9
2020-12-09 15:45:01 +10:00
Damien Elmes
4c3577b12e update Rust deps incl. Pyo3
This includes the refcount bug fix from pyo3 0.12.4
2020-12-01 16:48:45 +10:00
Damien Elmes
be6bd1322d expose Gaelic in language selection 2020-11-30 14:44:29 +10:00
Damien Elmes
c9b3ed1eae switch to workspace for Rust code 2020-11-24 18:41:03 +10:00
Damien Elmes
d85d0b88a1
Merge branch 'master' into init-lang 2020-11-22 16:10:49 +10:00
Damien Elmes
0b848eae56 update remaining python format strings to Fluent 2020-11-22 14:57:53 +10:00
abdo
7d7745fbb5 Set up default language before loading profile
We can make more strings translatable this way.
2020-11-21 05:29:23 +03:00
Damien Elmes
e23d40e850
Merge pull request #823 from RumovZ/rework-search-parser
Rework search parser
2020-11-20 16:22:12 +10:00
abdo
e3b4802f47 Fix description of exporters
Description broke yet again with the full migration to Fluent
2020-11-19 23:52:46 +03:00
RumovZ
cb2c19aced Add Python test for tag whitespace
Assert tag matches do not occur across different tags.
2020-11-19 09:28:19 +01:00
RumovZ
c185fb966b Merge branch 'master' into rework-search-parser
Conflicts:
    rslib/src/search/sqlwriter.rs
2020-11-18 09:04:04 +01:00
Damien Elmes
a86ce5a1d4 remove print statement from unit tests 2020-11-18 13:56:44 +10:00
Damien Elmes
1c5f94d46f strip out unused gettext refs 2020-11-18 13:22:51 +10:00
Damien Elmes
ffa26fe4bc fix remaining _() references; remove unused imports 2020-11-18 12:43:46 +10:00
Damien Elmes
177d98489a update pylib ngettext references 2020-11-18 09:12:25 +10:00
Damien Elmes
e9cd956acd drop i18n references in old stats 2020-11-18 09:12:03 +10:00
Damien Elmes
2453e5c488 update temporary val="%s" references to standard ftl 2020-11-17 22:00:44 +10:00
Damien Elmes
9d1b6231d7 merge pylib references 2020-11-17 19:23:06 +10:00
Damien Elmes
44489a480f map gettext strings to keys/modules for ftl conversion 2020-11-17 14:11:09 +10:00
RumovZ
d1ee507b3a Update frontend test to new escape handling 2020-11-15 09:39:10 +01:00
Damien Elmes
8e93b0ee38 use full path in backend_pb2 import 2020-11-13 14:21:21 +10:00
Damien Elmes
5bb3d7c114 format_fix -> format; rename svelte-check for consistency 2020-11-12 20:19:32 +10:00
Damien Elmes
2897707263 update Python deps 2020-11-12 20:03:41 +10:00
Damien Elmes
b0aedd6c76 orjson was missing from dep list; drop 32 bit compat 2020-11-12 20:03:41 +10:00
Damien Elmes
8ca023048a add coding specifier to anki/__init__.py
older gettext versions will complain otherwise (was breaking Windows CI)
2020-11-11 21:51:11 +10:00
Damien Elmes
0fcccae6e8
Merge pull request #817 from cecini/formatcheck
Update mypy and black format check to python version 3.8
2020-11-11 21:36:32 +10:00
Damien Elmes
8d4df820cc update i18n scripts
- export updated .po files for consumption
- add a script to pull and push translations
2020-11-11 21:08:06 +10:00
cecini
62da8e6a40 Update mypy and black format check to python version 3.8 2020-11-11 09:24:28 +00:00
Damien Elmes
fd5815653f fix error exporting v2 collection when translations don't match
https://forums.ankiweb.net/t/utf8-error-in-importing-deck/4430/13
2020-11-11 15:42:08 +10:00
Damien Elmes
6e3f971ae1 handle packaged pylib buildinfo.txt; drop aqt buildinfo 2020-11-11 10:33:49 +10:00
Damien Elmes
e99c0dbe15
Merge pull request #793 from nwwt/object-audio-tags-support
Audio & object tag support
2020-11-11 10:33:31 +10:00
Andreas Reis
e68a40f13e cleanup / renames
・ soundRegexps →  sound_regexps

・ htmlRegexps →  html_media_regexps

・ HTML_TAGS →  HTML_MEDIA_TAGS

・ escapeImages →  escape_media_filenames + alias

・ strip_html_preserving_image_filenames →  strip_html_preserving_media_filenames
2020-11-10 14:53:04 +01:00
ianki
c2901e4859 Add hooks for filtering media. 2020-11-09 02:12:23 -08:00
Damien Elmes
29ae7480f2 cleanups 2020-11-05 11:21:13 +10:00
Damien Elmes
95317a4f17 fix backend_pb2 race 2020-11-05 11:02:40 +10:00
Damien Elmes
927a44e36e unused import 2020-11-04 21:04:42 +10:00
Damien Elmes
0d354da93a move aqt_data into source folder; implement wheel building 2020-11-04 12:14:03 +10:00
Damien Elmes
9fe53ff549 switch to the stable Python ABI
Should allow the library to be imported in both Python 3.8+3.9.
2020-11-03 20:29:07 +10:00
Alan Du
562ea403b3 Update to PyO3 0.12
+ cargo raze by Damien
2020-11-02 18:38:34 +10:00
Damien Elmes
dc3bd07919 update cargo deps; add script to copy them from rslib/ 2020-11-02 18:17:26 +10:00
Damien Elmes
e0817c004d move backend.proto into rslib/ 2020-11-02 16:28:31 +10:00
Damien Elmes
45ed97c56c rspy -> pylib/rsbridge 2020-11-02 15:21:12 +10:00
Damien Elmes
b17d537a9e remove old makefiles 2020-11-01 14:41:01 +10:00
Damien Elmes
aea0a6fcc6 initial Bazel conversion
Running and testing should be working on the three platforms, but
there's still a fair bit that needs to be done:

- Wheel building + testing in a venv still needs to be implemented.
- Python requirements still need to be compiled with piptool and pinned;
need to compile on all platforms then merge
- Cargo deps in cargo/ and rslib/ need to be cleaned up, and ideally
unified into one place
- Currently using rustls to work around openssl compilation issues
on Linux, but this will break corporate proxies with custom SSL
authorities; need to conditionally use openssl or use
https://github.com/seanmonstar/reqwest/pull/1058
- Makefiles and docs still need cleaning up
- It may make sense to reparent ts/* to the top level, as we don't
nest the other modules under a specific language.
- rspy and pylib must always be updated in lock-step, so merging
rspy into pylib as a private module would simplify things.
- Merging desktop-ftl and mobile-ftl into the core ftl would make
managing and updating translations easier.
- Obsolete scripts need removing.
- And probably more.
2020-11-01 14:26:58 +10:00
Andreas Reis
6e9aaad11e Add audio & object tags to media check
Makes the media check recognize files in <audio> and <object> tags as used.

They've been observed/supported by the WebView (checked: Anki, AnkiDroid) since just about forever already and are extremely useful if one knows a thing about web dev.
2020-10-25 13:09:57 +01:00
Arthur Milchior
d6dd1849cf NF: uses consts and update comment according to code 2020-10-15 08:22:23 +02:00
Damien Elmes
a4a461c17b
Merge pull request #782 from johan456789/patch-1
fix outdated help site
2020-10-12 12:15:46 +10:00
Damien Elmes
727ddd74b6 fixes for latest mypy 2020-10-10 19:02:59 +10:00
johan456789
e8e5314a97
fix outdated help site 2020-10-07 19:38:49 +08:00
Damien Elmes
53a984ba15 bump version 2020-10-02 10:22:21 +10:00
Arthur Milchior
7850d2d662 NF: uses consts in col 2020-09-27 09:01:47 +02:00
Damien Elmes
c125893eba bump version 2020-09-24 10:52:24 +10:00
Arthur Milchior
51ba2b5870 NF: remove _changedGuids
Nothing is ever added to the map.
That was a bug detected by lint in ankidroid
2020-09-21 06:02:10 +02:00
Damien Elmes
45724a0474 small learning steps were being stored as a float
https://forums.ankiweb.net/t/bug-with-fractional-learning-intervals/3524/5
2020-09-20 10:29:39 +10:00
Damien Elmes
ade7f438ce rebuild_filtered_deck() and new_filtered() 2020-09-03 18:02:47 +10:00
Damien Elmes
f87fa762be empty_filtered_deck() 2020-09-03 17:43:07 +10:00
Damien Elmes
56ceb6ba76 set_deck() 2020-09-03 17:42:46 +10:00
Damien Elmes
b65174a026 move card sorting and resetting to backend 2020-09-03 15:54:15 +10:00
Damien Elmes
ce49ca9401 log manual reschedule, but ignore the log entry in the stats 2020-09-02 17:56:23 +10:00
Damien Elmes
39212a38aa move reschedCards() to backend 2020-09-02 17:56:23 +10:00
Damien Elmes
8f9037cf0f move filtered deck empty/fill to backend
emptying of individual card ids still to be done
2020-09-02 17:56:23 +10:00
Damien Elmes
8d2867aa2d fix night mode on old graphs 2020-09-02 17:56:12 +10:00
Damien Elmes
a834df60ce rename some card+note fields in backend 2020-09-01 10:24:38 +10:00
Damien Elmes
d3dede057a move bury/suspend into backend 2020-09-01 10:24:38 +10:00
Damien Elmes
ac265fe75a formatting fixes for latest black 2020-09-01 10:24:38 +10:00
Damien Elmes
ccfa989c62 move unbury/unsuspend routines into backend 2020-09-01 10:24:38 +10:00
Damien Elmes
e5685254c6 reimplement congrats screen in Rust+Typescript 2020-09-01 10:24:38 +10:00
Damien Elmes
5a4043524a add missing pylint/isort deps 2020-08-31 14:07:04 +10:00
Damien Elmes
a517accee3 update to latest black 2020-08-31 13:29:28 +10:00
Damien Elmes
603210149c update to latest isort, pylint and pytest 2020-08-31 12:05:36 +10:00
Damien Elmes
20432ccecf fix new pylint raise-missing-from lint 2020-08-31 12:04:14 +10:00
Damien Elmes
819dce3ab6 bump version 2020-08-31 11:07:54 +10:00
Damien Elmes
4662a9fe1a check if we need to unbury at the start of the sync process
https://forums.ankiweb.net/t/bug-buried-cards-in-filtered-decks-not-being-unburied-next-day/2541/24
2020-08-28 21:09:07 +10:00
Damien Elmes
96f9ad1f25 fix next learn message overestimating delay
https://forums.ankiweb.net/t/bug-with-short-intervals-in-anki-2-1-scheduler/2678
2020-08-27 09:35:31 +10:00
Damien Elmes
5355c3c25e fix description in export screen (thanks to ANH)
https://forums.ankiweb.net/t/anki-2-1-31-exporting-display-bug/2669/3
2020-08-26 08:33:35 +10:00
Damien Elmes
7e6a65ed3d bump version 2020-08-26 08:05:45 +10:00
Damien Elmes
7d7c791504 bump version 2020-08-24 11:28:22 +10:00
Damien Elmes
d266f9a80a revlog entry should not be deleted when undoing preview card
The plan is to add a revlog entry when previewing in the future; this
is just a temporary fix.
2020-08-19 16:44:06 +10:00
Arthur Milchior
c4db4bd291 Any removed 2020-08-12 01:37:21 +02:00
Arthur Milchior
c3b2b8625e NF: childMapNode 2020-08-12 00:42:42 +02:00
Damien Elmes
b380f304bf bump version 2020-08-09 13:44:59 +10:00
Damien Elmes
760ce2282d previous fs encoding test didn't catch things like latin-1
https://forums.ankiweb.net/t/unicodeencodeerror-when-syncing/1746
2020-08-03 11:29:07 +10:00
Damien Elmes
5a73641b57 enable strict equality checks in mypy
Without it, the following code reports no problems:

def foo() -> int:
    return 5
print(foo == 5)
2020-08-03 10:26:40 +10:00
Damien Elmes
2bcf9a82d1 fix missing translations in export screen
https://forums.ankiweb.net/t/untranslated-strings/1623
2020-07-31 13:33:41 +10:00
Damien Elmes
186ff1f185 pin pytest due to pylint issue 2020-07-29 14:52:45 +10:00
Matt Krump
5e6f532f56 Turn on check_untyped_defs for aqt.exporting 2020-07-28 18:42:22 -06:00
Damien Elmes
227703f9fa bump version 2020-07-28 12:59:56 +10:00
Damien Elmes
9f3eebfa80 force old graphs to use ltr
otherwise the axis labels are way off

https://forums.ankiweb.net/t/anki-2-1-29-beta/1220/8
2020-07-22 14:30:56 +10:00
Damien Elmes
412f1777bd bump version 2020-07-21 15:54:14 +10:00
Damien Elmes
01ff6ab55d apply rtl dir to webviews
https://forums.ankiweb.net/t/gui-problems-with-right-to-left-languages/1205
2020-07-21 11:52:25 +10:00
Damien Elmes
15f13145ea
Merge pull request #698 from Arthur-Milchior/remove_clear_overdue
remove _clearOverdue
2020-07-21 10:27:04 +10:00
Arthur Milchior
a3f8a15c37 remove unused variable 2020-07-20 10:17:23 +02:00
Arthur Milchior
5c9c5f6ebc duplicate assignment removed 2020-07-20 06:47:47 +02:00
Arthur Milchior
e02d47a0d9 typo 2020-07-20 06:28:36 +02:00
Arthur Milchior
0449785b7a remove useless variable cram 2020-07-20 06:24:42 +02:00
Arthur Milchior
3fd16beaa5 remove _clearOverdue
This member is never read
2020-07-20 05:45:18 +02:00
Damien Elmes
67abb98993
Merge pull request #692 from Arthur-Milchior/remove_useles_variables
Remove useless variables
2020-07-20 11:35:40 +10:00
Damien Elmes
928a1d3a75
Merge pull request #697 from Arthur-Milchior/typos
Comment typo
2020-07-20 11:34:02 +10:00
Damien Elmes
2bb5826598
Merge pull request #696 from Arthur-Milchior/note_to_add_note
For some reason, add_note were assigned to a unused variable
2020-07-20 11:32:55 +10:00
Damien Elmes
63c0557824
Merge pull request #695 from Arthur-Milchior/note->field
replace "note" by "field"
2020-07-20 11:32:30 +10:00
Arthur Milchior
ff62829e6e Comment typo 2020-07-19 11:24:58 +02:00
Arthur Milchior
35cfbc2bae For some reason, add_note were assigned to a unused variable
I remove it for clarity
2020-07-19 10:58:40 +02:00
Arthur Milchior
bff784dc9a replace "note" by "field"
My bad. In one case `f` did represent "field" and not "fact"
2020-07-19 08:24:43 +02:00
Arthur Milchior
23eeb84556 Uses constant in tests 2020-07-19 05:34:22 +02:00
Arthur Milchior
1b4a180fb9 d2->col2 2020-07-17 17:55:57 +02:00
Arthur Milchior
e7d75c2c8d tmp->col in tests 2020-07-17 17:37:17 +02:00
Arthur Milchior
e7378734d2 f4->note4 2020-07-17 17:34:39 +02:00
Arthur Milchior
0db941ed98 f3->note3 2020-07-17 17:33:58 +02:00
Arthur Milchior
9c5bb199d0 f->n in id 2020-07-17 17:30:29 +02:00
Arthur Milchior
93ad194862 NF: deck2->col2 2020-07-17 17:27:40 +02:00
Arthur Milchior
452daf8d80 Remove useless variables 2020-07-17 08:38:48 +02:00
Arthur Milchior
1af59545bd gn->deckn in test
Obtained by
```
sed -i "s/\bg1\b/deck1/g" pylib/tests/*py qt/tests/*py
sed -i "s/\bg2\b/deck2/g" pylib/tests/*py qt/tests/*py
```
2020-07-17 06:58:32 +02:00
Arthur Milchior
2c73dcb2e5 d->col in tests
obtained by
```
sed -i "s/\bd\b/col/g" pylib/tests/*py qt/tests/*py
```
2020-07-17 06:58:32 +02:00
Arthur Milchior
c376714a9b deck->col in tests
Obtained by
```
sed -i "s/\bdeck\b/col/g" pylib/tests/*py qt/tests/*py
```
2020-07-17 06:50:46 +02:00
Arthur Milchior
425b82e6e7 f2->note2 in test
Obtained by
```
sed -i "s/\bf2\b/note2/g" pylib/tests/*py qt/tests/*py
```
2020-07-17 06:47:44 +02:00
Arthur Milchior
4c25835d27 f->note in test
Obtained by sed -i "s/\bf\b/note/g" pylib/tests/*py qt/tests/*py
2020-07-17 06:47:44 +02:00
Arthur Milchior
6a529e51cc note->n
Next commit will transform f into note, and this lead to a variable clash here
2020-07-17 06:08:33 +02:00
Damien Elmes
19541c4a9d fix deck tree with a day delta, and support arbitrary timestamps 2020-07-06 19:16:03 +10:00
Damien Elmes
4d23a69e9a formatting 2020-07-01 14:01:24 +10:00
Damien Elmes
572e2d10dc hack around future unburied date
We want to avoid unburied != self.today, because the unburied time
is synchronized as part of the collection at the moment, and we don't
want a client with an older unburied time that was modified more
recently to cause cards to be unburied twice - so we only unbury
if today is more than 7 days earlier than the last unbury time.

Unsure what caused these users to end up in that state in the first
place:
https://anki.tenderapp.com/discussions/ankidesktop/41335-cards-remain-buried-forever-unless-manually-unburied
2020-07-01 13:12:45 +10:00
Damien Elmes
82568a1f3e experiment with exposing raw card/revlog data to frontend 2020-06-29 15:48:00 +10:00
Damien Elmes
3ca4a13cf2 protobuf package should be in PascalCase 2020-06-29 15:48:00 +10:00
Damien Elmes
d99ea0c7a0 fix media not working after full sync 2020-06-24 09:52:02 +10:00
Damien Elmes
83b3d3249f drop yellow colour in "filtered" for now
It's difficult to read against a light background
2020-06-16 16:39:07 +10:00
Damien Elmes
b51f03085e migrate card stats to backend
Currently this renders the HTML directly like the previous Python
implementation - doing it in JS would probably make more sense in the
future.
2020-06-15 17:22:16 +10:00
Damien Elmes
772c7a945c fix lint issues with latest mypy_protobuf 2020-06-14 15:38:43 +10:00
Damien Elmes
8e895aa247 handle db errors the same way as other backend requests 2020-06-12 20:39:02 +10:00
Damien Elmes
1cb0ac3670 update unit test for leech change 2020-06-09 14:12:34 +10:00
Damien Elmes
c4ead8ad28 strip out \r on export
(private post)
https://anki.tenderapp.com/discussions/ankidesktop/42315-bug-report-exporting-selected-cards-in-browser-issue
2020-06-09 12:56:16 +10:00