anki/qt/aqt
RumovZ 42cbe42f06
Plaintext import/export (#1850)
* Add crate csv

* Add start of csv importing on backend

* Add Menomosyne serializer

* Add csv and json importing on backend

* Add plaintext importing on frontend

* Add csv metadata extraction on backend

* Add csv importing with GUI

* Fix missing dfa file in build

Added compile_data_attr, then re-ran cargo/update.py.

* Don't use doubly buffered reader in csv

* Escape HTML entities if CSV is not HTML

Also use name 'is_html' consistently.

* Use decimal number as foreign ease (like '2.5')

* ForeignCard.ivl → ForeignCard.interval

* Only allow fixed set of CSV delimiters

* Map timestamp of ForeignCard to native due time

* Don't trim CSV records

* Document use of empty strings for defaults

* Avoid creating CardGenContexts for every note

This requires CardGenContext to be generic, so it works both with an
owned and borrowed notetype.

* Show all accepted file types  in import file picker

* Add import_json_file()

* factor → ease_factor

* delimter_from_value → delimiter_from_value

* Map columns to fields, not the other way around

* Fallback to current config for csv metadata

* Add start of new import csv screen

* Temporary fix for compilation issue on Linux/Mac

* Disable jest bazel action for import-csv

Jest fails with an error code if no tests are available, but this would
not be noticable on Windows as Jest is not run there.

* Fix field mapping issue

* Revert "Temporary fix for compilation issue on Linux/Mac"

This reverts commit 21f8a261408cdae49ec031aa21a1b659c4f66d82.

* Add HtmlSwitch and move Switch to components

* Fix spacing and make selectors consistent

* Fix shortcut tooltip

* Place import button at the top with path

* Fix meta column indices

* Remove NotetypeForString

* Fix queue and type of foreign cards

* Support different dupe resolution strategies

* Allow dupe resolution selection when importing CSV

* Test import of unnormalized text

Close  #1863.

* Fix logging of foreign notes

* Implement CSV exports

* Use db_scalar() in notes_table_len()

* Rework CSV metadata

- Notetypes and decks are either defined by a global id or by a column.
- If a notetype id is provided, its field map must also be specified.
- If a notetype column is provided, fields are now mapped by index
instead of name at import time. So the first non-meta column is used for
the first field of every note, regardless of notetype. This makes
importing easier and should improve compatiblity with files without a
notetype column.
- Ensure first field can be mapped to a column.
- Meta columns must be defined as `#[meta name]:[column index]` instead
of in the `#columns` tag.
- Column labels contain the raw names defined by the file and must be
prettified by the frontend.

* Adjust frontend to new backend column mapping

* Add force flags for is_html and delimiter

* Detect if CSV is HTML by field content

* Update dupe resolution labels

* Simplify selectors

* Fix coalescence of oneofs in TS

* Disable meta columns from selection

Plus a lot of refactoring.

* Make import button stick to the bottom

* Write delimiter and html flag into csv

* Refetch field map after notetype change

* Fix log labels for csv import

* Log notes whose deck/notetype was missing

* Fix hiding of empty log queues

* Implement adding tags to all notes of a csv

* Fix dupe resolution not being set in log

* Implement adding tags to updated notes of a csv

* Check first note field is not empty

* Temporary fix for build on Linux/Mac

* Fix inverted html check (dae)

* Remove unused ftl string

* Delimiter → Separator

* Remove commented-out line

* Don't accept .json files

* Tweak tag ftl strings

* Remove redundant blur call

* Strip sound and add spaces in csv export

* Export HTML by default

* Fix unset deck in Mnemosyne import

Also accept both numbers and strings for notetypes and decks in JSON.

* Make DupeResolution::Update the default

* Fix missing dot in extension

* Make column indices 1-based

* Remove StickContainer from TagEditor

Fixes line breaking, border and z index on ImportCsvPage.

* Assign different key combos to tag editors

* Log all updated duplicates

Add a log field for the true number of found notes.

* Show identical notes as skipped

* Split tag-editor into separate ts module (dae)

* Add progress for CSV export

* Add progress for text import

* Tidy-ups after tag-editor split (dae)

- import-csv no longer depends on editor
- remove some commented lines
2022-06-01 20:26:16 +10:00
..
browser Add the previewer_did_init hook (#1882) 2022-05-19 11:10:12 +10:00
data Plaintext import/export (#1850) 2022-06-01 20:26:16 +10:00
forms Add apkg import/export on backend (#1743) 2022-05-02 21:12:46 +10:00
import_export Plaintext import/export (#1850) 2022-06-01 20:26:16 +10:00
operations Add apkg import/export on backend (#1743) 2022-05-02 21:12:46 +10:00
qt Fix custom browser font not being honored 2022-04-21 13:28:22 +10:00
__init__.py Only require ANKI_WAYLAND if frozen 2022-04-20 19:41:41 +10:00
_macos_helper.py Import submodules directly (#1662) 2022-02-13 13:40:47 +10:00
about.py Fix issue #1114 by scrolling the user to the top of the page (#1810) 2022-04-19 15:39:32 +10:00
addcards.py Simplify name (#1620) 2022-01-24 11:55:15 +10:00
addons.py Fix a number of bugs with add-on conflict resolution (#1780) 2022-04-09 13:51:59 +10:00
BUILD.bazel run buildifier/buildozer to tidy up BUILD files 2021-12-14 09:18:24 +10:00
changenotetype.py Import submodules directly (#1662) 2022-02-13 13:40:47 +10:00
clayout.py Add the av_player_will_play_tags hook (#1842) 2022-05-09 11:08:34 +10:00
colors.py fix generated code symlinks again 2022-01-24 16:59:37 +10:00
customstudy.py Rework display of available cards in custom study 2022-05-20 17:52:02 +10:00
dbcheck.py Backup improvements (#1728) 2022-03-21 19:40:42 +10:00
deckbrowser.py Remove .exec() from QMenus in Deck Browser, Reviewer, and Card Template screens (#1674) 2022-02-18 17:18:29 +10:00
deckchooser.py Make dialogs non-blocking (#1650) 2022-02-10 09:53:13 +10:00
deckconf.py Import submodules directly (#1662) 2022-02-13 13:40:47 +10:00
deckdescription.py Import submodules directly (#1662) 2022-02-13 13:40:47 +10:00
deckoptions.py Remove .exec() from QMenus in Deck Browser, Reviewer, and Card Template screens (#1674) 2022-02-18 17:18:29 +10:00
editcurrent.py PEP8 editorMode 2022-01-12 15:01:43 +10:00
editor.py Make editor.cleanup() idempotent 2022-05-25 22:04:50 +10:00
emptycards.py Import submodules directly (#1662) 2022-02-13 13:40:47 +10:00
errors.py Add apkg import/export on backend (#1743) 2022-05-02 21:12:46 +10:00
exporting.py Add more progress + abort points to export code 2022-05-06 15:32:23 +10:00
fields.py Clean up webview after fields dialog closed 2022-03-04 17:23:28 +10:00
filtered_deck.py Fix various leaks (#1672) 2022-02-18 19:00:12 +10:00
flags.py Import submodules directly (#1662) 2022-02-13 13:40:47 +10:00
gui_hooks.py fix qt/ pylints 2021-01-07 16:21:50 +10:00
hooks_gen.py fix generated code symlinks again 2022-01-24 16:59:37 +10:00
importing.py Plaintext import/export (#1850) 2022-06-01 20:26:16 +10:00
legacy.py Import submodules directly (#1662) 2022-02-13 13:40:47 +10:00
main.py Rework display of available cards in custom study 2022-05-20 17:52:02 +10:00
mediacheck.py Add the media_check_did_finish hook (#1889) 2022-05-27 16:25:34 +10:00
mediasrv.py Plaintext import/export (#1850) 2022-06-01 20:26:16 +10:00
mediasync.py Add progress.single_shot() (#1683) 2022-02-24 21:15:56 +10:00
modelchooser.py Add callback and non-blocking option to StudyDeck (#1643) 2022-02-07 22:05:59 +10:00
models.py Make dialogs non-blocking (#1650) 2022-02-10 09:53:13 +10:00
mpv.py update platform checks (eg isWin -> is_win) + devMode 2021-11-25 09:06:16 +10:00
notetypechooser.py Make dialogs non-blocking (#1650) 2022-02-10 09:53:13 +10:00
overview.py Move custom study tag and limit gathering+saving into the backend 2022-03-10 16:23:03 +10:00
package.py ignore a spurious mypy error 2021-10-28 19:19:37 +10:00
pinnedmodules.py update platform checks (eg isWin -> is_win) + devMode 2021-11-25 09:06:16 +10:00
preferences.py Tweaks to video driver handling 2022-04-06 11:35:49 +10:00
profiles.py Add apkg import/export on backend (#1743) 2022-05-02 21:12:46 +10:00
progress.py Avoid progress window pop-up when application not focused 2022-05-26 12:35:39 +10:00
py.typed
reviewer.py Add the reviewer_will_replay_recording hook (#1877) 2022-05-18 13:44:56 +10:00
schema_change_tracker.py add a bunch of return types 2021-02-01 23:53:23 +10:00
sound.py Fix duplicate Anki icons appearing in dock 2022-05-26 11:05:36 +10:00
stats.py Fix issue #1114 by scrolling the user to the top of the page (#1810) 2022-04-19 15:39:32 +10:00
studydeck.py Fix new deck not being selected (#1681) 2022-02-22 21:51:23 +10:00
switch.py switch to new-style PyQt scoped enums and Qt6 2021-10-15 12:57:19 +10:00
sync.py Close browser before full sync or colpkg import/export 2022-04-19 17:10:34 +10:00
tagedit.py switch to new-style PyQt scoped enums and Qt6 2021-10-15 12:57:19 +10:00
taglimit.py Move custom study tag and limit gathering+saving into the backend 2022-03-10 16:23:03 +10:00
taskman.py Add apkg import/export on backend (#1743) 2022-05-02 21:12:46 +10:00
theme.py Update Python deps for Waitress fix 2022-03-23 22:22:23 +10:00
toolbar.py run pyupgrade over codebase [python upgrade required] 2021-10-04 15:05:48 +10:00
tts.py Update Python deps, including stable Black 2022-02-25 15:26:16 +10:00
undo.py fix redo menu item showing undo text 2021-08-04 10:28:45 +10:00
update.py PEP8 for rest of pylib (#1451) 2021-10-25 14:50:13 +10:00
utils.py Card type error (#1749) 2022-03-28 22:17:50 +10:00
webview.py Possible fix for Qt 6.3 crashes 2022-05-25 21:46:47 +10:00
wheel_description.txt move aqt_data into source folder; implement wheel building 2020-11-04 12:14:03 +10:00
winpaths.py run pyupgrade over codebase [python upgrade required] 2021-10-04 15:05:48 +10:00