Damien Elmes
2f2d376746
clean stale build folders before build
...
setuptools will bundle up files from that folder even if they're
no longer in the source tree.
2020-01-15 10:07:39 +10:00
Damien Elmes
ac9470dd5f
move hook gen code out of anki/
...
It's not needed at runtime, and this allows hooks to be updated
even when the code is broken.
2020-01-15 09:11:20 +10:00
Damien Elmes
e250550ac0
add _ prefix to generated classes to improve code completion
2020-01-15 08:58:27 +10:00
Damien Elmes
80d7333c9d
add some more hooks; stringify fully qualified types
...
To avoid circular imports, types that contain a '.' are automatically
converted to strings.
2020-01-15 08:56:56 +10:00
Damien Elmes
ac07cf3920
remove some comments that are no longer relevant
2020-01-14 20:45:18 +10:00
Damien Elmes
50729da84a
if profile is corrupt and is reset, need to set default lang again
...
Fixes https://anki.tenderapp.com/discussions/ankidesktop/37994-traceback-error-with-windows-64bit-standard-installation
2020-01-14 15:18:07 +10:00
Damien Elmes
2aae03cdf1
fix startup when prefs.db not readable
...
If we fail to open the Anki 2.0 prefs.db file, on the second try
we need to revert to a new file instead of trying the same broken
file again.
2020-01-14 14:59:46 +10:00
Damien Elmes
5b3852b2ba
if pm.meta() fails, need to unset pm
...
This prevents a startup failure caused by trying to set
the UI scale when .meta() is not working. Startup still
fails, but the correct message is displayed now.
2020-01-14 14:57:24 +10:00
Damien Elmes
7352e0f43b
switch to classes for hooks
...
This allows us to add a docstring to .append() so users can see
the names of the arguments that are being passed, and means we
don't have to remember to prepend run_ when calling a hook.
2020-01-14 08:54:07 +10:00
Damien Elmes
21feaf9a63
include py.typed for mypy
...
these builds are now available on
https://github.com/ankitects/anki-typecheck
The add-on docs will be updated shortly to provide info on
using the new hooks and type checking.
2020-01-13 21:18:03 +10:00
Damien Elmes
2834cdcc6a
add license to wheels and option to skip bundling extra files
2020-01-13 20:04:23 +10:00
Damien Elmes
555d1f0e55
add a flag to handle the legacy hook missing args case
...
And update a few more hooks.
2020-01-13 18:37:08 +10:00
Damien Elmes
3d94af972e
update the rest of the anki/ hooks/filters
2020-01-13 17:59:52 +10:00
Damien Elmes
ad59c96bdd
run black on generated hooks
2020-01-13 17:55:58 +10:00
Damien Elmes
765c7a143c
buildinfo required to generate hooks
2020-01-13 14:55:32 +10:00
Damien Elmes
aa8b1645a7
add separate file for gui hooks
2020-01-13 14:38:05 +10:00
Damien Elmes
ae4ea8db22
New type-safe approach to hooks/filters
...
Still todo:
- Add separate module for GUI hooks
- Update the remaining runHook/runFilter() calls
- Document the changes, including defensive registration
2020-01-13 13:57:51 +10:00
Damien Elmes
356962cb2c
mark anki and aqt modules as having typing info
...
This means once they're installed via develop or a wheel, add-ons
will be able to more easily typecheck their code against the Anki
code.
2020-01-13 13:03:37 +10:00
Damien Elmes
74d0db0bb5
update translations
...
update translations
2020-01-10 08:21:52 +10:00
Glutanimate
4be8351d2c
Add hook for AddCards.addNote
2020-01-08 21:29:28 +01:00
Damien Elmes
34ac272349
show stdout/stderr when running tests
2020-01-08 15:52:51 +10:00
Damien Elmes
9232414095
bump minimum python version from 3.6 to 3.7
2020-01-07 18:34:36 +10:00
Damien Elmes
b1b2cae2bb
remove dupe line
2020-01-06 20:59:18 +10:00
Damien Elmes
194697753d
don't need to rerun checks each time buildhash changes
2020-01-06 19:30:54 +10:00
Damien Elmes
f710d558fd
add tests and setup.py to checks; fix warnings
2020-01-06 15:27:59 +10:00
Erez Volk
8707ffe02a
BUGFIX: QLineEdit doesn't have .toPlainText()
2020-01-05 07:54:45 +02:00
Damien Elmes
27ff4b6a26
skip the automatic push
2020-01-05 08:52:46 +10:00
Damien Elmes
dcf244a44e
update translations
2020-01-05 08:43:39 +10:00
Damien Elmes
d1f5ff4694
make file context relative to root
2020-01-05 08:35:46 +10:00
Damien Elmes
2e86079712
clearer commit message
2020-01-05 08:35:08 +10:00
Damien Elmes
96f721b8c6
update
2020-01-05 08:15:47 +10:00
Damien Elmes
95145addcb
add missing pywin32
2020-01-05 07:34:36 +10:00
Damien Elmes
7334d7a687
wheel deps should be checked at install time, not build time
2020-01-05 07:34:36 +10:00
Glutanimate
a0de4ca0e1
Use add-on name rather than package name when reporting on conflicts
...
Brings _installationSuccessReport more in line with messaging in
AddonManager.toggleEnabled
2020-01-04 04:49:36 +01:00
Glutanimate
34cba492ab
Further tweak messaging depending on Anki's state at installation time
2020-01-04 04:45:43 +01:00
Glutanimate
af508cec71
When possible, install add-on before add-ons are loaded
...
Removes the need to restart Anki if it is not running when
user launches .ankiaddon file
2020-01-04 04:34:16 +01:00
Glutanimate
e4c3a23007
Fix type hints and remove obsolete argument
2020-01-04 04:31:33 +01:00
Glutanimate
6a37cd05bb
Make sure to pass pending imports on to installAddon
...
also: refactor add-on check
2020-01-04 04:30:33 +01:00
Damien Elmes
1fa01bca67
don't reference missing readme in setup.py
2020-01-04 12:21:58 +10:00
Damien Elmes
39f2ca54e8
quieten wheel build
2020-01-04 12:21:58 +10:00
Damien Elmes
c88694333b
update readme, remove submodule readmes
2020-01-04 12:21:58 +10:00
Damien Elmes
351699268a
move top level scripts into makefile
2020-01-04 12:21:58 +10:00
Glutanimate
e1e848c6ed
Merge branch 'ankiaddon-filetype-handling' of https://github.com/Glutanimate/anki into ankiaddon-filetype-handling
2020-01-04 02:36:28 +01:00
Glutanimate
be89378ee2
Adjust type annotations, format string, and remove tooltip on cancel
...
Other areas of Anki don't confirm cancelling actions with tooltips,
so after further consideration, the tooltip felt out of the place and
might have actually confused users into thinking some action was
being performed.
2020-01-04 01:30:20 +01:00
Aristotelis
e6a3e7360b
Merge pull request #1 from amboss-mededu/add-amboss-contrib
...
Add AMBOSS as a contributor
2020-01-03 18:45:20 +01:00
Yann Salimi
f70f7dd518
Add AMBOSS as a contributor
2020-01-03 18:37:50 +01:00
Glutanimate
b61610142e
Fix mypy and black checks
2020-01-03 18:23:28 +01:00
Glutanimate
6cad2b2983
Add .ankiaddon mime-type on Linux and register Anki as its handler
2020-01-03 17:58:11 +01:00
Glutanimate
8b2588f079
Extend CLI with the ability to install .ankiaddon packages
...
Allows Anki to register a mime-type handler for .ankiaddon files
Other small collateral changes:
+ fix positioning issues with some prompts and progress dialog
+ add prompt titles where they were missing
+ add type annotations for AddonManager installation methods
+ explicitly import os in main (used to be imported via aqt.qt)
2020-01-03 17:57:33 +01:00
Glutanimate
74b0899ef1
Extend showInfo with the ability to add custom buttons
...
Grants more flexibility in user prompt design
2020-01-03 17:48:17 +01:00