Commit graph

854 commits

Author SHA1 Message Date
Michal Pokorný (Rai)
1e9833ab2a Whitespace reformat to force 80-character line limit 2019-12-23 00:30:59 +01:00
Damien Elmes
af4d4af55d fix race condition in tmp folder handling 2019-12-22 19:03:20 +10:00
Damien Elmes
7399e0bd2b Model->NoteType 2019-12-22 08:58:56 +10:00
Damien Elmes
079a00653e
Merge pull request #369 from agentydragon/typecheck-models
Add types for models, templates and field dicts
2019-12-22 08:19:40 +10:00
Michal Pokorný (Rai)
67a39c58cb Add types for models, templates and field dicts 2019-12-21 12:02:16 +01:00
Damien Elmes
bfcc837939 avoid noreturn for now, as it's not supported on python <3.6.5 2019-12-21 16:54:40 +10:00
Damien Elmes
f0f9278414
Merge pull request #363 from ig3/bug/new-perday
Use _deckNewLimitSingle in _groupChildrenMain
2019-12-21 07:41:18 +10:00
Damien Elmes
ed0b3d3374 add an example of how circular imports can be handled
The type name needs to be quoted so it is evaluated after the module
has been initialized.

In the future when we drop support for python 3.6, and mypy is updated,
we will be able to remove the quotes and use the following at
the top of the file instead:

from __future__ import annotations
2019-12-21 07:29:45 +10:00
Ian Goodacre
329ca71436 Use _deckNewLimitSingle in _groupChildrenMain 2019-12-21 09:26:51 +13:00
Damien Elmes
c1587254f4 use isort to tidy up imports 2019-12-20 19:19:29 +10:00
Damien Elmes
12093f2f2e add a bunch of extra hints for mypy 2019-12-20 16:40:20 +10:00
Damien Elmes
d8d7e78b6b remove typings from some other files
not used frequently enough to deal with the mypy errors they're causing
at the moment
2019-12-20 16:33:49 +10:00
Damien Elmes
b6b8df2dcf add a bunch of annotations for mypy 2019-12-20 15:07:40 +10:00
Damien Elmes
068b10103c fix media.check() sig 2019-12-20 11:58:50 +10:00
Damien Elmes
f170763ef1 exporting, latex 2019-12-20 11:47:19 +10:00
Damien Elmes
55795822b5 importing 2019-12-20 11:41:24 +10:00
Damien Elmes
c415a70e72 lang/media/storage 2019-12-20 11:27:01 +10:00
Damien Elmes
f74ee52c73 decks 2019-12-20 11:07:08 +10:00
Damien Elmes
efd78e66ef models 2019-12-20 11:07:08 +10:00
Damien Elmes
6ffe82ac54 db/hooks/utils 2019-12-20 11:07:08 +10:00
Damien Elmes
f69ef52845 collection 2019-12-20 11:07:08 +10:00
Damien Elmes
912e1bad03 cards/notes 2019-12-20 11:07:08 +10:00
Damien Elmes
9c16d59086 type hints for scheduler 2019-12-20 11:07:08 +10:00
Damien Elmes
6ecfff56c5 add pytype inferred types to anki/
I've corrected some obvious issues, and we can fix others over time.
Mypy tests are currently broken, as adding the type hints has increased
mypy's testing surface.
2019-12-20 11:07:08 +10:00
Damien Elmes
5418af00f7 Revert "DeckManager: _checkDeckTree ignore case"
This reverts commit 9955048aec.

This commit broke collections that had children under each of the
the duplicate names - it renames one of the decks, but the children
of the renamed deck are left without a parent, causing an error like

line 235, in deckDueList  nlim = min(nlim, lims[p][0])\n\nKeyError('..)

Rather than a more complicated approach, I think it's safer just to
leave the case or normalization-differing decks around for now, and
we can normalize things properly in a future schema upgrade.
2019-12-20 08:18:01 +10:00
Damien Elmes
cfd78367d4 don't set local offset in server mode 2019-12-17 17:10:56 +10:00
Damien Elmes
e59af745f7
Merge pull request #361 from Arthur-Milchior/testReqs
test req
2019-12-16 20:44:23 +10:00
Damien Elmes
d7cb7eaea0 avoid recalculating reqs in actions like adding cards 2019-12-16 20:27:58 +10:00
Damien Elmes
81e3acd599 fixes cycles in template imports 2019-12-16 18:16:26 +10:00
Damien Elmes
2d6173a631 don't try to decode str 2019-12-16 18:08:17 +10:00
Damien Elmes
5c008a328e clarify hasIllegal() arg 2019-12-16 17:54:57 +10:00
Damien Elmes
67d8284a33 mpv was passing separators incorrectly and unnecessarily 2019-12-16 17:54:40 +10:00
Damien Elmes
d4145d1f04 fix type inference in scheduler 2019-12-16 17:54:17 +10:00
Damien Elmes
6f7c8915fe fix mplayer typecheck 2019-12-16 17:54:04 +10:00
Damien Elmes
21108650fc handle invalid field mod regex 2019-12-16 17:53:43 +10:00
Damien Elmes
b06b2f26f0 Sniffer technically expects a string, not a list 2019-12-16 17:53:20 +10:00
Damien Elmes
b935c7e89b work around some typing inference issues 2019-12-16 17:52:51 +10:00
Damien Elmes
d2f4450dc0 platform-specific imports 2019-12-16 17:51:33 +10:00
Damien Elmes
c9820fae99 ignore missing props in the supermemo importer 2019-12-16 17:50:43 +10:00
Damien Elmes
b4b8717a20 set instance vars in __init__() 2019-12-16 17:49:32 +10:00
Damien Elmes
1da52f89fe be explicit in our not-None assumptions to appease type checker 2019-12-16 17:47:07 +10:00
Damien Elmes
6757b30e72 pytype is confused by import from parent module
this change prevents the cache from constantly being rebuilt
2019-12-16 17:41:47 +10:00
Arthur Milchior
a1d602f154 update requireds saves reqs as lists instead of tuples.
The goal of this change is to be consistent with JSON. Indeed, the
dictionnary is saved as JSON, which has list and does not has
tuple. The request was made in https://github.com/dae/anki/pull/361#issuecomment-565915191
2019-12-15 22:55:29 -08:00
Damien Elmes
a2c9b160ca don't try to remove tmp folder if it's already been removed 2019-12-16 10:07:20 +10:00
Damien Elmes
4e377a3b33 fix travis build 2019-12-16 08:22:47 +10:00
Damien Elmes
37a239cf38 add basic type checking for anki/ 2019-12-16 08:17:28 +10:00
Damien Elmes
81bdd860f3 bump version 2019-12-15 15:32:24 +10:00
Damien Elmes
4bc33e2f19 save local timezone to conf
saves the user needing to visit AnkiWeb when their timezone has changed
2019-12-12 11:30:01 +11:00
Damien Elmes
7f2fecb944 sort due in filtered decks by ordinal, like normal review
https://anki.tenderapp.com/discussions/ankidesktop/37419-card-order-of-siblings-not-preserved-in-filtered-deck#comment_47910714
2019-12-11 08:12:50 +10:00
Damien Elmes
5a5be92d09 add a token 1 day bonus so easy on a relearn card differs from good
https://anki.tenderapp.com/discussions/beta-testing/1589-anki-2116-beta#comment_47905454
2019-12-09 12:12:29 +10:00