Commit Graph

29273 Commits

Author SHA1 Message Date
Kovid Goyal 390b0d45c1 Dont use a python file to store catalog section templates 2019-03-25 20:18:19 +05:30
Kovid Goyal 7bd05cbfeb Another bs4 incompat to port 2019-03-25 20:01:13 +05:30
Kovid Goyal d9ab752f94 DRYer 2019-03-25 18:54:01 +05:30
Kovid Goyal 5918acabad Misc fixes for the last py3 porting merge 2019-03-25 16:03:25 +05:30
Kovid Goyal c8688930ad Fix various itervalues() that dict_fixes missed 2019-03-25 15:39:39 +05:30
Kovid Goyal 0fcad5f21f Fix various uses of iteritems missed by dict_fixes 2019-03-25 15:29:08 +05:30
Kovid Goyal b0d6aec8ed Fix breakage caused by dict_six auto-fixes 2019-03-25 15:08:56 +05:30
Kovid Goyal 5d46f5fbeb Get rid of iterkeys
dict.__iter__() is the same as iterkeys on both py2 and py3
2019-03-25 14:31:32 +05:30
Kovid Goyal 7fd70a28e8 Remove unused code 2019-03-25 14:28:09 +05:30
Kovid Goyal ba70f43118 Fix regressions introduced by autopep8 2019-03-25 13:45:24 +05:30
Kovid Goyal 33cea777ac Merge branch 'py3' of https://github.com/eli-schwartz/calibre 2019-03-25 13:32:21 +05:30
Kovid Goyal d115058106 Use the library comments_to_html() function to format comments for e-book catalogs
The original massage_comments() function was largely a duplicate and
also did not work with bs4
2019-03-25 13:25:17 +05:30
Kovid Goyal e178f179e1 ... 2019-03-25 11:36:02 +05:30
Kovid Goyal ba59ac679d Fix incorrect soup usage in various recipes
Also make SoupStrainer available in calibre.ebooks.BeautifulSoup
2019-03-25 10:17:27 +05:30
Kovid Goyal de9d97d688 Port use of BS for comments_html() 2019-03-25 09:52:45 +05:30
Kovid Goyal 9395c717ed Fix usages of soup.prettify() 2019-03-24 14:35:58 +05:30
Kovid Goyal 5e097e3ac7 Port use of BS in Kindle and Kobo drivers 2019-03-24 14:23:24 +05:30
Kovid Goyal 2fc337d779 Dont use str(soup) 2019-03-24 13:36:45 +05:30
Kovid Goyal 19d4a453e8 ... 2019-03-24 13:23:43 +05:30
Kovid Goyal 296eda53ea Do not use BeautifulSoup to read HTML tocs 2019-03-24 13:15:50 +05:30
Kovid Goyal a3c0ce3b24 Do not use BeautifulSoup to postprocess the jacket
Avoids an extra parse
2019-03-24 12:41:40 +05:30
Kovid Goyal 3045dc3c71 Port use of BeautifulSoup in LRF output 2019-03-24 12:18:42 +05:30
Kovid Goyal c8f94a552b Get rid of soupparser as bs4 has no parser of its own 2019-03-24 12:18:42 +05:30
Kovid Goyal 256c7563b6 Port use of renderContents and BeautifulStoneSoup 2019-03-24 12:18:42 +05:30
Kovid Goyal c89b656df4 Port usage of BeautifulSoup Tag constructor 2019-03-24 12:18:42 +05:30
Kovid Goyal 692230147c Start work on porting to beautifulsoup4 2019-03-24 12:18:42 +05:30
Kovid Goyal 78b7112012 Fix using --insert-metadata with ebook-convert not inserting the title and author metadata from the source document 2019-03-24 12:17:21 +05:30
Eli Schwartz 4f545af415 autopep8 2019-03-24 01:18:27 -04:00
Eli Schwartz a623717d96 python3: apply various fixes from python-modernize "dict_six"
Imports were then fixed and consolidated to derive from the internal
polyglot.builtins
2019-03-24 01:18:27 -04:00
Eli Schwartz f61dcf6b1a python3: more BytesIO 2019-03-24 00:54:58 -04:00
Eli Schwartz 69711828bd python3: make lopen a direct alias for the builtin open
Thanks to PEP 0446, its reason to exist no longer applies and it is the
default behavior. However, trying to use it on python3 resulted in
errors since "e" is no longer a valid open() mode.
2019-03-24 00:54:58 -04:00
Eli Schwartz 391ca722e0 python3: PEP 3114 compliance for next() and iterators 2019-03-24 00:23:15 -04:00
Eli Schwartz 9ecadb9c13 python3: use exec() instead of execfile() 2019-03-24 00:23:15 -04:00
Kovid Goyal 930624d2be pep8 2019-03-22 23:48:01 +05:30
Kovid Goyal 3c86c9be6f pep8 2019-03-21 20:40:28 +05:30
Kovid Goyal 47ed2df137 Various fixes for the latest py3 commit 2019-03-21 18:33:19 +05:30
Eli Schwartz d66fdc2df7 autopep8 2019-03-21 01:27:21 -04:00
Eli Schwartz cb85e778d8 python3: fix various uses of itertools.i(map|zip)
Use the existing polyglot.builtins / future_builtins versions.
Also smooth over izip_longest, but don't bother with another polyglot
module for one function used in two places.
2019-03-21 01:27:21 -04:00
Eli Schwartz 45f68f552b python3: make coffee build
add polyglot.socketserver wrapper and fix BaseHTTPServer.HTTPServer
2019-03-21 01:27:21 -04:00
Eli Schwartz 8aceae428e py3: make setup.py gui work
Apparently compileUi explicitly opens the file/buffer as unicode, not
bytes, and then writes a unicode header string (containing the source
file). So the previous attempt to use BytesIO was wrong in this case.

Also images.qrc is being constructed completely in the right here and
now from a bunch of unicode strings, so just use exactly that.
2019-03-20 23:56:30 -04:00
Eli Schwartz 8e125b56a0 python3: listify the range() generator before appending to it
We explicitly need a list here.
2019-03-20 23:56:30 -04:00
Kovid Goyal 9386839320 Various ixes for the previous polyglot commit 2019-03-20 21:11:45 +05:30
Eli Schwartz e828a4bd98 python3: more use of unicode_type
These metadata sources files are part of the infrastructure, not the
parts which are downloaded.
2019-03-20 08:44:26 -04:00
Eli Schwartz 83b055122a python3: add polyglot.queue wrapper 2019-03-20 08:44:23 -04:00
Eli Schwartz ea6a210e70 python3: wire up more code to polyglot.http_server 2019-03-20 08:43:58 -04:00
Eli Schwartz 8594f52fe8 python3: add more urllib wrappers 2019-03-20 08:43:54 -04:00
Eli Schwartz 1653c790db remove dead code
Initially added in commit c1ef643b8e but I
cannot tell what it was ever used for.
2019-03-20 08:43:22 -04:00
Eli Schwartz 2d382274cd py3: gettext no longer has a unicode= argument
This is unicode by default "since there's no point in translating to
byte strings." Good riddance.
2019-03-20 08:43:22 -04:00
Kovid Goyal 042d740593 ... 2019-03-20 15:02:31 +05:30
Kovid Goyal ae735b2ea3 De-vendor html2text 2019-03-20 14:42:46 +05:30