Go to file
dequis 37ba8832f8 Make hooks.wrap preserve signatures, fixes hooking some pyqt5 callbacks
It looks like pyqt5 is playing dirty and checking the number of args of
functions before calling them. When using hooks.wrap, pyqt5 thinks it
can pass any amount of arguments (because *args) and you get exceptions
like this inside the wrap function, when calling the 'old' function:

>TypeError: onFindDupes() takes 1 positional argument but 2 were given

This commit fixes it by preserving the signature of the wrapped method,
by adding an optional dependency on the "decorator" module.

Making it an optional dependency is probably not the wisest idea but
since this is a small edge case it might be smoother to start like this.

I also added functools.wraps() as a fallback, which won't help much but
is slightly more correct.

See this article for details: https://hynek.me/articles/decorators/
2017-07-16 23:25:34 -03:00
anki Make hooks.wrap preserve signatures, fixes hooking some pyqt5 callbacks 2017-07-16 23:25:34 -03:00
aqt catch windows firewall issue 2017-07-09 13:26:50 +10:00
designer switch undo shortcut 2017-06-24 19:24:43 +10:00
tests Revert "don't rely on cwd in media.py" 2017-04-11 12:50:33 +10:00
tools fix make install for source 2017-01-17 11:25:55 +10:00
.gitignore fix i18n on linux install 2012-12-21 18:04:26 +09:00
.travis.yml Update Python versions for Travis CI builds 2017-02-26 22:03:12 +02:00
anki.1 merged libanki and ankiqt into single distro 2012-12-21 16:51:59 +09:00
anki.desktop update anki.desktop (thanks to julian) 2017-01-24 18:29:31 +10:00
anki.png merged libanki and ankiqt into single distro 2012-12-21 16:51:59 +09:00
anki.xml merged libanki and ankiqt into single distro 2012-12-21 16:51:59 +09:00
anki.xpm merged libanki and ankiqt into single distro 2012-12-21 16:51:59 +09:00
LICENSE elaborate on bsd license 2016-05-06 09:51:30 +10:00
LICENSE.logo update links in license.logo 2017-01-24 18:15:28 +10:00
Makefile fix make install for source 2017-01-17 11:25:55 +10:00
README.addons update addon docs 2017-07-05 12:41:05 +10:00
README.contributing fixing typo 2017-01-30 08:30:20 +01:00
README.development fix reqs 2017-01-11 13:35:45 +10:00
README.md Update README.md broken link 2017-03-09 15:13:30 -06:00
requirements.txt Make hooks.wrap preserve signatures, fixes hooking some pyqt5 callbacks 2017-07-16 23:25:34 -03:00
runanki explicit python3 in runanki, remove /usr/share ref 2016-06-28 15:47:09 +10:00

Anki

This is the development branch of Anki.

For stable builds, please see https://apps.ankiweb.net.

For non-developers who want to try this development code, the easiest way is to use a binary package - please see https://anki.tenderapp.com/discussions/beta-testing

If you're a developer, you can learn more about building Anki in README.development.

Build Status