Damien Elmes
7fda601aef
add some typehints, and remove some unused code
2021-01-31 20:56:21 +10:00
Damien Elmes
5d810dd799
make backend instance on col private
2021-01-31 18:56:16 +10:00
Damien Elmes
6c483bb577
add public wrappers for remaining backend functions
2021-01-31 18:56:16 +10:00
Damien Elmes
c7f92f0737
fix _backend files not getting format checked
2021-01-31 18:56:16 +10:00
Damien Elmes
ea31e8ca3e
move the remaining exports from _backend
2021-01-31 18:56:16 +10:00
Damien Elmes
260a270eb0
embed BuiltinSortKind
2021-01-31 18:56:16 +10:00
Damien Elmes
5974163343
embed kind enum in StockNoteType and remove prefix
2021-01-31 18:56:16 +10:00
Damien Elmes
248e067da7
add back basic rsbackend.py for compatibility
2021-01-31 18:55:45 +10:00
Damien Elmes
9815d96461
remove template_legacy.py
2021-01-31 18:55:45 +10:00
Damien Elmes
67cb147493
move rsbridge into _backend
2021-01-31 18:55:45 +10:00
Damien Elmes
9d853bbb03
start work on more clearly defining backend/protobuf boundaries
...
- anki._backend stores the protobuf files and rsbackend.py code
- pylib modules import protobuf messages directly from the
_pb2 files, and explicitly export any will be returned or consumed
by public pylib functions, so that calling code can import from pylib
- the "rsbackend" no longer imports and re-exports protobuf messages
- pylib can just consume them directly.
- move errors to errors.py
Still todo:
- rsbridge
- finishing the work on rsbackend, and check what we need to add
back to the original file location to avoid breaking add-ons
2021-01-31 18:55:45 +10:00
RumovZ
cd9767be80
Remove unused BackendNoteTypeID
2021-01-31 08:57:10 +01:00
Damien Elmes
cb805cf355
Merge branch 'more-backend-search' into main
2021-01-31 14:21:51 +10:00
Damien Elmes
8410330f94
move drag/drop deck logic to backend
2021-01-31 13:46:31 +10:00
RumovZ
4745b55d27
Revert addition of pb.NoteIDs
2021-01-30 12:59:18 +01:00
RumovZ
80a4a85510
Remove redundant docstring
2021-01-30 10:37:46 +01:00
Damien Elmes
cb6b88da0f
simplify nid/nids searches, and ditch helper function
...
- IdList could be re-used for a cids: search in the future if required.
- Embedding the message means it's easy to access from Python as
an attribute of SearchTerm.
2021-01-30 11:37:00 +10:00
Damien Elmes
1adc9952f4
simplify Dupe message and ditch helper function
...
Calling code doesn't need to know about the existence of such helpers;
it can just rely on code completion to discover the required arguments.
2021-01-30 11:10:26 +10:00
Damien Elmes
5e6dd54c8e
export SearchTerm from collection.py, and avoid exporting embedded items
2021-01-30 11:01:11 +10:00
Damien Elmes
73b897c754
rename FilterToSearchIn in backend to match frontend
2021-01-30 10:54:21 +10:00
RumovZ
c299e271e8
Refactor search_string() and FilterToSearchIn
...
See #955 .
2021-01-29 18:27:33 +01:00
Damien Elmes
5ff7944a26
add getter/setter for boolean config values
2021-01-29 21:03:19 +10:00
RumovZ
349bd9d681
Use proper docstrings
2021-01-29 09:40:21 +01:00
RumovZ
1fb6024454
Rename filters added_in etc. to added_in_days
2021-01-29 09:38:13 +01:00
Damien Elmes
7693879e3c
remove unused set_all_config; expose .all_config().
2021-01-29 16:30:42 +10:00
RumovZ
423d7e5098
Use backend filter for findDupes and handle excep.
2021-01-28 19:49:16 +01:00
RumovZ
d33442f901
Add backend filter for field name
2021-01-28 19:48:01 +01:00
RumovZ
407358ab68
Use backend nid filter in browser
2021-01-28 16:21:56 +01:00
RumovZ
51e1e82a9a
Add helper functions for search strings in col
2021-01-28 11:13:57 +01:00
Maksim Abramchuk
0eb653559a
Remove unused variable
2021-01-26 21:37:16 +00:00
Damien Elmes
31a3add848
fix finished screen not showing when learning cards due later
2021-01-25 21:12:57 +10:00
Damien Elmes
2a875ffc55
Merge pull request #934 from hgiesel/graphprefs
...
Add GraphsPreferences API to graphs for setting persistent preferences
2021-01-23 21:24:41 +10:00
Damien Elmes
37ca8afaf6
minor wording tweak: GraphsPreferences -> GraphPreferences
2021-01-23 20:47:45 +10:00
Damien Elmes
10757d563d
refresh new/rev counts when fillNew/fillRev() fails
...
This was the behaviour before, but got lost when ._reset_counts() was
added. Also added the check back to schedv2:fillRev(), which also
appears to have gotten lost in the move to ._reset_counts()
Just a stop-gap fix until this code can get a proper rewrite.
2021-01-23 14:02:05 +10:00
Damien Elmes
ce2315591f
remove "invalid current deck"
...
This should resolve itself when a user clicks on a deck.
2021-01-23 13:04:58 +10:00
Henrik Giesel
bf130d1da0
Change the function name in genbackend.py
2021-01-22 20:05:28 +01:00
Henrik Giesel
665a13e378
Add GraphsPreferences endpoint to backend
2021-01-22 13:13:48 +01:00
abdo
bf0086d565
Use new backend filters in rename_tag()
2021-01-16 18:49:48 +03:00
abdo
e018ea94b6
Merge branch 'master' of https://github.com/ankitects/anki into tagtree
2021-01-15 01:12:01 +03:00
abdo
2ff584c44d
Pass escaped name to bulk_update in rename_tag
2021-01-14 18:38:46 +03:00
abdo
9c1d7c522a
Refactor code for clearing unused tags and saving collapse state
2021-01-14 07:04:14 +03:00
RumovZ
7b9cc017c4
Use backend to set dupe filter
2021-01-14 10:42:37 +10:00
Damien Elmes
633034b24d
add local sync server frontend
2021-01-13 11:42:00 +10:00
abdo
72e8f9d640
Merge branch 'master' of https://github.com/ankitects/anki into tagtree
2021-01-12 23:31:58 +03:00
Damien Elmes
fbd91b22f5
tidy up UTC offset handling/timing calculations
...
- use the TimestampSecs newtype instead of raw i64s
- use FixedOffset instead of a minutes_west offset
- check localOffset each time the timing is calculated, and set it
if it's stale - even for v1.
- check for and fix missing rollover when calculating timing
- stop explicitly passing localOffset in the sync/start call
2021-01-12 21:32:56 +10:00
Damien Elmes
9bc8434538
remove temporary sync/dbcheck logging
2021-01-12 18:47:08 +10:00
Damien Elmes
1425379d41
drop basicCheck()
...
It can considerably slow down syncing on large collections
2021-01-12 18:47:08 +10:00
Damien Elmes
401d5dd9cc
Merge pull request #917 from hgiesel/querynozero3
...
Coerce added/edited:0 to 1, Constrain rated:n to 1-365
2021-01-11 16:24:12 +10:00
Henrik Giesel
250b89be60
Adjust pyblib test_find
2021-01-10 16:25:52 +01:00
RumovZ
942632d579
Also add FilterToSearch to want_release_gil()
2021-01-10 11:31:00 +01:00