38570 Commits

Author SHA1 Message Date
Kovid Goyal
ae35cdd814
Fix #1033 (py3: When changing a dict, iterate over a copy of its items) 2019-08-21 19:47:11 +05:30
Kovid Goyal
efd5eefa0f
Micro-optimization 2019-08-21 19:45:27 +05:30
Kovid Goyal
7b936ee3ea
Merge branch 'py3' of https://github.com/eli-schwartz/calibre 2019-08-21 14:03:23 +05:30
Kovid Goyal
60d4bbf57d
py3 compat 2019-08-20 21:09:20 +05:30
Eli Schwartz
80beb72b65
py3: more work toward universal __future__s 2019-08-20 07:56:02 -04:00
Eli Schwartz
1cd54361c0
micro-optimize: use sorted(generator) instead of sorted(newlist)
Or just use the initial value.
2019-08-20 07:55:54 -04:00
Eli Schwartz
074e3ff829
py3: use QByteArray().data() to get bytestring instead of str()
b'1' can be mapped into an int, but 'b"1"' cannot. Also rename one
instance -- the QMimeData class requires using the data() method to
retrieve content, and QByteArray uses data() to retrieve the raw bytes,
but once we get to data.data().data() it's a bit ridiculous. So make the
first one be called md, as is used in other mime handling code too.
2019-08-20 07:52:42 -04:00
Eli Schwartz
6ce8e01801
py3: use for loop/hardcode instead of map to process many arguments
Even though we adapted to python3 by using a tuple to ensure the
function is actually applied, this still uses a surprising language
feature then allocate a tuple that is immediately tossed away.
2019-08-20 07:52:42 -04:00
Eli Schwartz
f7aa4cda79
simplify path construction with os.path.join 2019-08-20 07:52:41 -04:00
Eli Schwartz
af81778588
remove unworking, unlisted recipe from 2011
This was incorrectly named *.py, so it was never added to
builtin_recipes.zip and could not be used. Attempting to rename and use
it yields 404 errors for each feed, so it cannot be trivially rescued;
therefore, delete it.
2019-08-20 07:52:41 -04:00
Eli Schwartz
2fe269a161
Use https urls where possible. 2019-08-20 07:52:41 -04:00
Eli Schwartz
96c71e7ae4
QbyteArray().data() is always bytes and does not need to be cast to it
a dbus.ByteArray() can simply be initialized from the QByteArray
directly.
2019-08-20 07:52:41 -04:00
Eli Schwartz
d0a30b1f84
py3: add string_or_unicode to polyglot
To facilitate universal __future__s, we prefer native_string_type to
str. Since we cannot compare things as instance(f, (str, unicode_type))
and it gets a bit ridiculous to compare:

from polyglot.builtins import native_string_type, unicode_type
isinstance(f, (native_string_type, unicode_type))

allow using isinstance(f, string_or_unicode) instead. This matches the
existing string_or_bytes comparator.
2019-08-20 07:52:41 -04:00
Eli Schwartz
24cd46cc70
misc cleanup set([]) 2019-08-20 07:52:41 -04:00
Kovid Goyal
06755d5eba
Fix an error when adding files from clipboard and file is of unknown type 2019-08-20 16:08:40 +05:30
Kovid Goyal
ced7df0b20
Remove unnecessary list comprehension 2019-08-20 14:16:26 +05:30
Kovid Goyal
1a53ef945a
Dont rely on the shell to restart calibre on macOS 2019-08-20 14:14:10 +05:30
Kovid Goyal
b657ba60d7
Update Foreign Affairs 2019-08-19 08:27:33 +05:30
Kovid Goyal
099cbca59c
Get parse_index() working for foreign affairs AJAX backend 2019-08-18 17:52:49 +05:30
Kovid Goyal
d7458841e1
Update bundled mechanize 2019-08-18 14:09:19 +05:30
Kovid Goyal
9808bf69c9
Update derStandaard 2019-08-18 13:03:45 +05:30
Kovid Goyal
7460a12a4b
Complete fix for WSJ login logic change 2019-08-14 20:52:37 +05:30
Kovid Goyal
ac9f1fc2d9
change wording slightly 2019-08-14 08:50:06 +05:30
Kovid Goyal
4353f2ab9d
Update Globe and Mail 2019-08-14 06:50:51 +05:30
josue
175b747657 Updated The Globe and Mail recipe: article titles no longer include section the article belongs to, added article meta data to remove tags because it was taking up almost 1 full page of dummy text, added real estate section, updated newspaper name to its proper one 2019-08-13 21:08:05 -04:00
Kovid Goyal
b9d5842e00
Update CNET News 2019-08-13 20:12:36 +05:30
Kovid Goyal
6c3fd548a5
... 2019-08-13 11:16:41 +05:30
Kovid Goyal
c5aeaa8c8a
Cleanup HTML metadata parsing 2019-08-12 10:10:50 +05:30
Kovid Goyal
44e54bffc4
Merge branch 'html_identifier_import' of https://github.com/cszucko/calibre 2019-08-12 09:00:10 +05:30
Christopher Szucko
b12c75c904 Add unit tests for HTML metadata imports 2019-08-11 10:14:15 -05:00
Christopher Szucko
a81ff78c0a Escape HTML entities in comments 2019-08-11 10:13:25 -05:00
Christopher Szucko
8cbaa3a9e2 Fix importing ratings from HTML metadata
The HTML import was assuming ratings were out of 5 but the internal representation is out of 10
2019-08-11 10:13:25 -05:00
Christopher Szucko
d36a23d795 Refactor HTML metadata parsing
Use an HTMLParser rather than regex, only parse the document once, and add handling for multiple values for authors, tags, and languages
2019-08-11 10:13:25 -05:00
Kovid Goyal
5d1379fbec
Speed up restoring original format by doing a rename rather than a copy and re-add. Fixes #1839733 [Restore pre conversion originals very slow](https://bugs.launchpad.net/calibre/+bug/1839733) 2019-08-11 19:23:50 +05:30
Kovid Goyal
91a0659a9c
EPUB 3: Fix setting metadata in EPUB 3 files with a title not working 2019-08-10 22:15:36 +05:30
Kovid Goyal
b808ee0078
... 2019-08-10 22:12:53 +05:30
Kovid Goyal
93911255f6
Fix #1028 ( Fix podofo convert pystring to PdfString bug ) 2019-08-10 19:34:11 +05:30
Kovid Goyal
e1e3f41065
py3: Another fix 2019-08-10 13:30:51 +05:30
Kovid Goyal
92e5dcb078
py3: more future imports 2019-08-10 13:25:22 +05:30
Kovid Goyal
b71bd6478b
Workaround for weird PyQt return with error set in the conversion dialog
Probably a regression in the latest version of PyQt, but rather than
track it down, easier to just get rid of the .ui file anyway.
2019-08-10 13:05:36 +05:30
Kovid Goyal
38b5c97eeb
Cleanup 2019-08-10 11:47:10 +05:30
Kovid Goyal
6099c69d6f
PML Input: Modernize the generated HTML a bit. Fixes #1839689 [Some PML conversions cause FlightCrew errors](https://bugs.launchpad.net/calibre/+bug/1839689) 2019-08-10 07:15:35 +05:30
Christopher Szucko
9c846f3b51 Support Dublin Core id tags when importing HTML
All of the below formats are supported and would be interpreted as "foo:bar"
<meta name="DC.identifier" scheme="foo" content="bar" />
<meta name="dc:identifier.foo" content="bar/>
<meta name="DCTERMS:identifier" scheme="foo" content="bar" />
<meta name="dcterms.identifier.foo" content="bar" />
2019-08-09 09:38:49 -05:00
Kovid Goyal
c1663d3cc8
HTMLZ Output: Fix svg content from HTML files that contain only SVG being removed. Fixes #1839522 [all images wrapped in <svg> element are lost in htmlz output](https://bugs.launchpad.net/calibre/+bug/1839522) 2019-08-09 15:57:18 +05:30
Kovid Goyal
ab708af9da
Fix #1839494 [Application crashes on changing icons](https://bugs.launchpad.net/calibre/+bug/1839494) 2019-08-08 22:29:03 +05:30
Kovid Goyal
6042ed1dc5
A better fix for python3.7 smtplib breakage 2019-08-08 19:54:59 +05:30
Kovid Goyal
b1623bc558
py3: More fixes 2019-08-08 19:29:23 +05:30
Kovid Goyal
383d6cde29
Update National Geographic 2019-08-08 10:05:59 +05:30
Kovid Goyal
69ea54fa15
py3: more fixes 2019-08-07 22:35:58 +05:30
Kovid Goyal
5e7c625685
Use mbcs encoding when passing filenames to windows 2019-08-07 20:16:23 +05:30