Commit Graph

38053 Commits

Author SHA1 Message Date
Eli Schwartz d0844e8bbe do not use names which conflict with builtin str type 2019-05-27 00:41:14 -04:00
Eli Schwartz 85884e3fdd py3: more bytestring fixups while porting unicode_literals 2019-05-27 00:41:14 -04:00
Eli Schwartz 89e2638cdd py3: work towards enforce all __future__s everywhere
In various places, update division to use // (unless it specifically
wanted a float).
Drop use of u'' literals.
2019-05-27 00:41:14 -04:00
Eli Schwartz 4d547f40e7 py3: various bytestring fixups while porting unicode_literals
- use bytestrings to write raw xml data
- compare bytestream to bytestring when checking formats
- use bytestrings to search inside mobi_html (rebased on master). Since
  it starts life as a bytestring it does not need to be reconverted.
2019-05-27 00:41:14 -04:00
Eli Schwartz 45ca4c7934 py3: merge multiline __future__ imports to not confuse 2to3 2019-05-27 00:41:14 -04:00
Kovid Goyal 66c0721ba7 py3: Port preprocess.py
Now uses unicode literals and also fix various regexps that failed to
compile or raised future warnings under py3
2019-05-27 09:39:47 +05:30
Kovid Goyal ed9b4fe49b PDF Input: Workaround for pdftohtml not always producing valid UTF-8. Fixes #1830568 [calibe failed to convert pdf to mobi](https://bugs.launchpad.net/calibre/+bug/1830568) 2019-05-27 08:37:53 +05:30
Kovid Goyal da404870ca py3: More unicode_literals and str() porting 2019-05-26 20:43:21 +05:30
Kovid Goyal f3b64dfbe2 Merge branch 'executable-bit' of https://github.com/aimylios/calibre 2019-05-26 12:35:46 +05:30
Aimylios 1d5389e73f Unset executable bit of various files
and add shebang to one of the remaining executable scripts.
2019-05-26 08:27:09 +02:00
Kovid Goyal 436a4da649 Fix a regression when porting udisks.py 2019-05-26 10:20:03 +05:30
Kovid Goyal a523330738 py3: More unicode_literals and str() porting 2019-05-26 09:52:37 +05:30
Kovid Goyal d8af514a92 Fix #998 (py3: Load plugins from the same (correct) path) 2019-05-26 07:36:00 +05:30
Kovid Goyal 7114083e09 Restore the dynamic_property builtin for third party plugins 2019-05-26 07:21:04 +05:30
Kovid Goyal 10f57cf499 Merge branch 'shebang' of https://github.com/aimylios/calibre 2019-05-25 17:53:13 +05:30
Aimylios e417743bdb Remove space characters from djvu shebangs 2019-05-25 13:05:36 +02:00
Kovid Goyal d7cb0787fd py3: More unicode_literals and str() porting 2019-05-25 13:10:48 +05:30
Kovid Goyal 297f8fc41a Remove not working recipe (RSS feeds have been discontinued) 2019-05-24 17:17:41 +05:30
Kovid Goyal 83862873ef Remove workaround for different html5-parser versions in test as CI servers have been updated with up-to-date html5-parser 2019-05-24 12:59:54 +05:30
Kovid Goyal 77966f6c7d Ignore failures to set the timefmt in the LRB recipe 2019-05-24 07:44:11 +05:30
Kovid Goyal ba5f3cdce7 The Baffler by Jose Ortiz 2019-05-24 07:38:16 +05:30
Kovid Goyal 85fbb87b82 py3: More unicode_literals and str() porting 2019-05-23 08:50:31 +05:30
Kovid Goyal 50af7ba51f py3: port uses of builtin functions that were changed to return iterators 2019-05-23 06:57:33 +05:30
Kovid Goyal b8832d5a31 Fix crash in create catalog dialog if changing from EPUB to MOBI and then switching tabs 2019-05-21 19:48:54 +05:30
Kovid Goyal e501fa8d86 Fix converting RTF files with debug pipeline not working 2019-05-21 19:17:28 +05:30
Kovid Goyal 031756c4bc py3: Port the catalog generation GUI 2019-05-21 19:00:02 +05:30
Kovid Goyal 2952e47fa4 py3: More str() and unicode_literals fixes 2019-05-20 19:22:45 +05:30
Kovid Goyal 9d14bebafb Fix str() and unicode_literals in odf package 2019-05-20 17:17:33 +05:30
Kovid Goyal 43c0b1216e Fixes found by check 2019-05-20 16:56:45 +05:30
Kovid Goyal 7ab9970d33 ... 2019-05-20 16:52:53 +05:30
Kovid Goyal 8366df8637 Run code quality checks on the odf package 2019-05-20 16:52:16 +05:30
Kovid Goyal 609892eb81 Run autopep8 on odf2xhtml 2019-05-20 16:14:07 +05:30
Kovid Goyal ed1571af6e py3: remove has_key from odf2xhtml 2019-05-20 16:12:42 +05:30
Kovid Goyal cb5ac309fa py3: More fixes to RTF input
Embedded WMF image processing now works
2019-05-20 15:50:36 +05:30
Kovid Goyal 037e28a442 py3: misc fixes for RTF input 2019-05-20 15:24:05 +05:30
Kovid Goyal 27580b8cbe py3: use unicode literals in rtf2xml 2019-05-20 15:22:04 +05:30
Kovid Goyal 6e157be8fa py3: centralize creation of rtf file objects so they can be controlled easily 2019-05-20 15:04:41 +05:30
Kovid Goyal 3e64b73c96 py3: make mreplace polyglot 2019-05-20 13:40:20 +05:30
Kovid Goyal 749885778d Some fixes to the last py3 merge 2019-05-20 12:57:05 +05:30
Kovid Goyal 4c5e9a20a4 Merge branch 'py3' of https://github.com/eli-schwartz/calibre 2019-05-20 12:20:25 +05:30
Eli Schwartz c6e0698c36 py3: partial work towards making rtf2xml actually work 2019-05-20 00:55:14 -04:00
Eli Schwartz a8a74b7c53 py3: use proper dict.keys() handling 2019-05-20 00:55:14 -04:00
Eli Schwartz 4b0e241555 py3: make pdf input work 2019-05-20 00:55:13 -04:00
Eli Schwartz 9f65185da3 py3: make fb2 input work 2019-05-20 00:55:13 -04:00
Eli Schwartz aa43816d09 py3: make txtz input work 2019-05-20 00:55:13 -04:00
Eli Schwartz fda2ab0024 py3: make html output work
The templates are initialized as decoded unicode strings, and templite
expects to work in unicode strings as well. However, etree.tostring
returns a bytestring unless explicitly told to use the 'unicode'
encoding ('utf-8' is not enough)
2019-05-20 00:55:13 -04:00
Eli Schwartz f75ea236e5 py3: make templite templates use python3-compatible syntax 2019-05-20 00:55:13 -04:00
Eli Schwartz 65c0ca944b py3: make pml input work
Opening a file in binary mode in python3 returns a BufferedReader which
does not have an encoding attribute. Assume in this case it is
functionally equivalent to None.

I'm not sure when pml_stream.encoding will ever equal anything, since
even on python2 the attribute exists but is None when opening files in
binary mode... which we explicitly do. So I'm not sure why this ever
checks the existing encoding. Possibly when the input plugin is given a
file opened in text mode, not raw mode? in that case, it may be wrong to
always decode it when reading.
2019-05-20 00:55:13 -04:00
Eli Schwartz 1ed017fabd py3: make pmlz output work
in python3, the re module is more picky about what arguments are used
with it, and invalid escapes do not fall back on being treated as string
literals, but raise an error. Use raw strings to ensure that the escaped
backslashes are preserved all the way to the regular expressions
themselves.
2019-05-20 00:55:13 -04:00
Eli Schwartz 8e368c0d46 py3: more fixes for snb output
string.split is deprecated, use native functions on the original string
itself.
2019-05-20 00:55:13 -04:00