Damien Elmes
dfb3cd6444
fix some type errors/lints
2019-12-23 11:32:19 +10:00
Damien Elmes
9e245ae621
apply black to all files
2019-12-23 10:34:10 +10:00
Michal Pokorný (Rai)
b474c0aa46
Add some type declarations in utils.py
2019-12-22 14:47:07 +01:00
Damien Elmes
910d2132df
fix race condition in tmp folder handling
2019-12-22 19:03:20 +10:00
Michal Pokorný (Rai)
c22e22e8ae
Add types for models, templates and field dicts
2019-12-21 12:02:16 +01:00
Damien Elmes
8095ad8e4b
use isort to tidy up imports
2019-12-20 19:19:29 +10:00
Damien Elmes
96bb318c8e
add a bunch of extra hints for mypy
2019-12-20 16:40:20 +10:00
Damien Elmes
dc0fdaeea5
add a bunch of annotations for mypy
2019-12-20 15:07:40 +10:00
Damien Elmes
6818234679
db/hooks/utils
2019-12-20 11:07:08 +10:00
Damien Elmes
9983774a12
add pytype inferred types to anki/
...
I've corrected some obvious issues, and we can fix others over time.
Mypy tests are currently broken, as adding the type hints has increased
mypy's testing surface.
2019-12-20 11:07:08 +10:00
Damien Elmes
513aef78cf
platform-specific imports
2019-12-16 17:51:33 +10:00
Damien Elmes
6e19639a8c
don't try to remove tmp folder if it's already been removed
2019-12-16 10:07:20 +10:00
Damien Elmes
df69b03995
fix travis build
2019-12-16 08:22:47 +10:00
Arthur Milchior
f9ddb4abd9
Adding explanation to translators
...
Some strings are missing in French at least. And some are quite
complex to understand. Especially without context, without knowledge
of Python. I tried to copy the only indication I found and add more
indication, hoping I did it correctly.
2019-10-24 02:36:32 +02:00
Damien Elmes
8c6d5b6332
keep json in utils for add-on compat
...
https://anki.tenderapp.com/discussions/beta-testing/1399-anki-2110-beta#comment_47036452
2019-03-06 07:18:26 +10:00
Damien Elmes
75a95ee1fb
tidy up unused imports
2019-03-04 17:25:19 +10:00
Damien Elmes
300231e318
use raw strings for regexs
2019-03-04 17:03:43 +10:00
Damien Elmes
7d0f7ae33c
fix some warnings
2019-03-04 16:01:10 +10:00
Damien Elmes
b9957d820a
use distro in place of deprecated dist() method
2019-03-04 15:39:10 +10:00
Damien Elmes
8981da61c1
silence some spurious errors and remove some unused code
2019-03-04 11:22:40 +10:00
Damien Elmes
085679d5d1
move versionWithBuild into anki module
2019-02-28 08:37:42 +10:00
Damien Elmes
a7eb6bb357
update copyright and clarify licenses
2019-02-05 14:01:33 +10:00
Damien Elmes
9d20de871b
run latex commands without bundled libs
...
https://anki.tenderapp.com/discussions/ankidesktop/30531-latex-wont-generate-svgs-automatically-but-will-generate-pngs
2018-10-28 11:41:43 +10:00
Damien Elmes
d3fd519d0b
remove comments when stripping
...
gets rid of unwanted metadata from ms word pastes
2018-06-09 16:27:46 +10:00
Damien Elmes
b2c2cbf421
fix time translation patch
2017-12-04 12:33:23 +10:00
Damien Elmes
7c520c55df
night mode
2017-12-04 12:20:56 +10:00
Piotr Kubowicz
b821c70929
Allow to better translate "in x minutes"
...
"There is 1 minute" and "in 1 minute" need to be translated
differently in Slavic languages.
Additionally remove unused afterTimeTable.
2017-11-30 20:03:51 +01:00
Damien Elmes
8cfc1e1315
stripHTML() should work when tag split over multiple lines
2017-09-30 15:33:05 +10:00
Damien Elmes
0543a4533b
add devMode flag to utils
...
also remove the extra toolbar call in loadProfile(), as we require a
restart to update the translations anyway
2017-08-01 14:28:13 +10:00
Damien Elmes
17d68cc957
use a clearer name for fmtQA()
2017-03-14 15:48:40 +09:00
Henrik Enggaard Hansen
1dfc4466f1
Move card formatting to anki.utils
2017-03-13 15:52:02 +01:00
Illia Volochii
13b7e01044
Stop inheriting from object
...
It is not needed in Python 3.
2017-02-07 00:21:33 +02:00
Damien Elmes
27c23c01d6
some html regexps should be case insensitive
2016-10-24 19:42:03 +10:00
Damien Elmes
04c13d1348
use full path to packaged audio commands
...
ensures we use the packaged version over the system version
2016-07-26 12:15:43 +10:00
Damien Elmes
63499fb7e9
fix entsToTxt()
2016-05-15 15:43:46 +10:00
Damien Elmes
15b349e3a8
start port to python 3
...
unit tests pass and main screens of GUI load
2016-05-12 14:45:35 +10:00
Soren I. Bjornstad
72b4148127
make sure temp folder hasn't been deleted since creation
2014-06-24 14:50:39 -05:00
dae
85488afb8f
add TimedLog for debugging
2014-06-03 17:26:06 +09:00
Damien Elmes
3c36ddfb82
don't allow files named . or ..
2014-02-10 20:47:49 +09:00
Damien Elmes
db77c8c80b
make sure simplejson always returns unicode
2013-11-10 04:57:15 +09:00
Damien Elmes
3ed2861115
include platform in cv
2013-10-06 04:37:39 +09:00
Damien Elmes
f23392b6a3
Merge pull request #35 from hssm/compile-regex
...
Pre-compile HTML-stripping regexes.
2013-10-04 13:39:44 -07:00
Damien Elmes
2ba8c41fec
replace nbsp with standard space when stripping html
...
fixes https://anki.tenderapp.com/discussions/ankidesktop/1952-duplicate-not-detected-on-paste
2013-07-11 21:23:13 +09:00
Houssam Salem
0ce829b6b3
Pre-compile HTML-stripping regexes.
2013-06-23 18:37:39 +10:00
Damien Elmes
0dceb0ce22
round() doesn't convert to int
2013-05-15 23:37:27 +09:00
Mike Blume
dcf097b55f
use futuristic division
...
Python used to use C-style division, where division of two ints was
truncated, and division involving a float resulted in a float.
This is confusing, because you often can't tell from looking at a
line of code in isolation what sort of division it's supposed to do.
With 'from __future__ import division' Python ensures that division is
always explicit.
// means (floored) integer division
/ means float division
regardless of argument types.
This should make the source a bit clearer now, as well as removing one
obstacle if Anki is ever ported to Python 3.
2013-05-05 11:09:16 -07:00
Damien Elmes
ed9fba954e
handle extra attributes in imgs in condition repl ( #700 )
2013-04-11 18:34:53 +09:00
Damien Elmes
0b7344c84f
when showing time with no decimal, round not floor
2013-04-01 14:48:17 +09:00
Damien Elmes
fa07268763
don't allow invalid chars in file export ( #694 )
2013-02-20 15:12:07 +09:00
Damien Elmes
ea89be5f4a
make sure we encode data as utf8 before checksumming
2013-01-08 10:42:15 +09:00