Commit graph

76 commits

Author SHA1 Message Date
Damien Elmes
8729edffbb update to latest black 2020-08-31 13:29:28 +10:00
Damien Elmes
204db71586 fix new pylint raise-missing-from lint 2020-08-31 12:04:14 +10:00
Arthur Milchior
110f4c664f Any removed 2020-08-12 01:37:21 +02:00
Arthur Milchior
a74601a0f0 NF: childMapNode 2020-08-12 00:42:42 +02:00
Damien Elmes
3a75161778 fix deck tree with a day delta, and support arbitrary timestamps 2020-07-06 19:16:03 +10:00
Damien Elmes
55f8b87548 support generating a due tree for a different date 2020-06-05 09:38:31 +10:00
Damien Elmes
854c524ecf fix mtime being bumped in .reset() 2020-06-01 13:57:10 +10:00
evandrocoan
3d2dcc8cec Added super().__repr__() to new __repr__() calls 2020-05-31 19:39:19 -03:00
evandrocoan
45cb996cc9 Added __repr__ functions to common objects 2020-05-31 19:39:19 -03:00
Damien Elmes
e9fea26d1c use keyword args for calls with more than one argument 2020-05-24 09:12:47 +10:00
Damien Elmes
35489d5fa7 add some more newtypes to the RPC defs 2020-05-23 16:58:01 +10:00
Damien Elmes
32a071cf79 migrate decks and dconf methods 2020-05-23 15:09:16 +10:00
Damien Elmes
927ed25b02 more methods 2020-05-23 14:01:36 +10:00
Damien Elmes
d57ded706f migrate more methods to service 2020-05-22 22:09:33 +10:00
Damien Elmes
7676748e6c fix deletion of decks; allow deleting cards from default
https://anki.tenderapp.com/discussions/beta-testing/1967-2126-189-g7384df8f-crash-at-note-types-fields-save#comment_48353232
2020-05-22 11:24:56 +10:00
Damien Elmes
d31f2d8c23 move deck/notetype update hooks to gui
We need to migrate away from firing hooks in libanki, since libanki
methods may be running on a background thread, and hook consumers
typically expect the code to run in the main thread. We could document
it, but it would frequently be forgotten about, and could lead to
crashes.

https://anki.tenderapp.com/discussions/ankidesktop/41748-qobject-cannot-create-children-for-a-parent-that-is-in-a-different-thread-when-hitting-the-save-button-on-clayoutpy-window
2020-05-22 10:47:14 +10:00
Damien Elmes
068cc43095 storage->collection 2020-05-20 17:58:28 +10:00
Damien Elmes
94722c4fbb minor tidyups in decks.py 2020-05-17 20:13:29 +10:00
Damien Elmes
b676522e5c fix renaming corner cases and decks.update()
- .update() should update a single deck and preserve usn by default,
as that's what existing code expects
- decks are automatically renamed when they conflict with an existing
name
2020-05-17 19:07:15 +10:00
Damien Elmes
2c19e171ed handle deletion of default deck in backend; use + instead of _ 2020-05-17 15:22:19 +10:00
Damien Elmes
6728da62c5 fix shared deck conf warning 2020-05-17 14:37:59 +10:00
Damien Elmes
336349d8d1 update before_upload() 2020-05-17 14:13:21 +10:00
Damien Elmes
8a42896fb8 speed up children() and add deck_and_child_ids() 2020-05-16 15:40:07 +10:00
Damien Elmes
c138917773 formatting 2020-05-16 14:59:47 +10:00
Damien Elmes
b3205e5d5d only update active when selecting deck/resetting
We were previously doing this every time a card was answered.
2020-05-16 14:57:46 +10:00
Damien Elmes
f76b82d8ae add find_deck_in_tree() 2020-05-16 13:05:20 +10:00
Damien Elmes
7de2fa5b58 remove unused default(Dynamic)Deck 2020-05-15 21:47:33 +10:00
Damien Elmes
cbfc9d5a87 handle default deck and filtered deck suppression in the backend 2020-05-15 21:21:10 +10:00
Damien Elmes
7d14008216 remove dconf cache 2020-05-12 21:13:33 +10:00
Damien Elmes
267be1b050 add missing decks in backend
- need to compare parents with unicode case folding
- duplicate check enforced by the DB
2020-05-12 21:13:33 +10:00
Damien Elmes
13d23cd24b speed up browser load by rendering deck tree in Rust and skipping counts 2020-05-12 21:13:33 +10:00
Damien Elmes
24ef0cc6f1 add separate decks table, and start on moving deck handling to Rust
The Python tests are passing, but there are still a number of issues
to work through, and the table/protobuf schema is not yet finalized.
2020-05-12 21:13:33 +10:00
Damien Elmes
cffe9fb7bd if conf points to an invalid configuration, fall back on default 2020-04-30 11:45:13 +10:00
Damien Elmes
826e8e4120 Revert "remove unused decks.count()"
This reverts commit dd790390db.

dd790390db
2020-04-13 19:26:12 +10:00
Damien Elmes
dd790390db remove unused decks.count() 2020-04-10 10:25:31 +10:00
Damien Elmes
0538d9b764 (de)serialize decks in backend 2020-04-09 12:41:59 +10:00
Arthur Milchior
6e36bc5f2e immediate_parent 2020-04-06 23:56:24 +02:00
Arthur Milchior
8290f9ff2a immediate_parent_path 2020-04-06 23:55:17 +02:00
Arthur Milchior
d095b017e4 _basename to basename, since it's not private in use 2020-04-06 23:51:50 +02:00
Arthur Milchior
859178c113 _basename used where possible 2020-04-06 23:51:42 +02:00
Arthur Milchior
e6024d4d3d replace _path by path (because it's not private here) 2020-04-06 23:50:43 +02:00
Arthur Milchior
8962194dcb uses _path where possible 2020-04-06 23:50:37 +02:00
Arthur Milchior
7bef7ef8ec Sort decks according to their paths
Currently it's sorted alphabetically. Because of this, "A::B" appears
between "A9" and "AA" in list of decks.
2020-04-06 22:49:25 +02:00
Arthur Milchior
b94f138989 make _path static 2020-04-06 22:45:30 +02:00
Damien Elmes
b5022ad354 store config in separate DB table
- mtime is tracked on each key individually, which will allow
merging of config changes when syncing in the future
- added col.(get|set|remove)_config()
- in order to support existing code that was mutating returned
values (eg col.conf["something"]["another"] = 5), the returned list/dict
will be automatically wrapped so that when the value is dropped, it
will save the mutated item back to the DB if it's changed. Code that
is fetching lists/dicts from the config like so:

col.conf["foo"]["bar"] = baz
col.setMod()

will continue to work in most case, but should be gradually updated to:

conf = col.get_config("foo")
conf["bar"] = baz
col.set_config("foo", conf)
2020-04-06 15:39:47 +10:00
Arthur Milchior
c837143d31 Remove useless recursion in DeckManager.rem
For any deck the children of it's children are its children. So
applying rem to children of children is useless and actually slightly
costly for deep subdecks
2020-04-05 11:33:23 +02:00
Damien Elmes
ac54f85840 update tag handling
- tag list stored in a separate DB table
- non-wildcard searches now do full unicode case folding
(eg tag:masse matches 'Maße')
- wildcard matches do simple unicode case folding
- some functions haven't been updated yet, so ascii folding will
continue to be used in some operations
2020-04-03 19:34:46 +10:00
Damien Elmes
07c414692e preserve mtime/usn when syncing deck config, and add snake_case names 2020-04-03 19:34:46 +10:00
Damien Elmes
296ebd9c63 set col mod explicitly in decks.select() 2020-04-03 19:34:46 +10:00
Damien Elmes
cbfc0207ec tolerate string values in deck["conf"] 2020-04-01 19:36:40 +10:00