Closed mikkkee closed 1 year ago
Looks good, could you please add a test that just calls this API?
Looks good, could you please add a test that just calls this API?
Hi thanks for your comments but I'm not sure how to run tests for an Anki plugin.
Does it work if I simply add the following function to /tests/test_graphical.py
?
def test_guiImportFile(setup):
ac.guiImportFile()
Yep, assuming that passes, something like that should be just fine!
Yep, assuming that passes, something like that should be just fine!
Thank you! just committed the test
oops looks it breaks the test, weird because it worked when I loaded the plugin locally
plugin/__init__.py:44: in <module>
from aqt.import_export.importing import import_file, prompt_for_file_then_import
E ModuleNotFoundError: No module named 'aqt.import_export'
Looks it's due to version, i.e., Anki 2.1.45 doesn't have this aqt.import_export
folder yet
Another error is from Qt.WindowStaysOnTopHint
which should be Qt.WindowType.WindowStaysOnTopHint
in Qt6.
Hi,
Thanks for this great plugin! Hope you can have a look at this PR when you have a moment.
Currently AnkiConnect only supports importing of
apkg
file. This PR adds the support to import all file types by adding a GUI action to bring up the "Import... (Ctrl+Shift+I)" dialog.If a path is provided, it brings up an "Import File" window with provided file. If no path is provided, it brings up select file window followed by "Import File" window.
To avoid being overlooked by the user, Anki window is brought to front in this action.
See below screenshot for the "Import File" window brought up by the following command in PowerShell.
Thanks a lot.
Please kindly let me know if any comments.