Commit graph

54 commits

Author SHA1 Message Date
Kovid Goyal
f8f464efc0
Content server OPDS: Handle form encoded search queries. Fixes #1841464 [calibre server search by URL with multiple words not working](https://bugs.launchpad.net/calibre/+bug/1841464) 2019-08-27 13:42:03 +05:30
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
Kovid Goyal
b86e9f0f27
py3: Various MOBI fixes found while reviewing the previous py3 merge 2019-07-07 18:14:13 +05:30
Kovid Goyal
c243fa2358
Cleanup getenv 2019-06-10 19:06:36 +05:30
Kovid Goyal
057b873933
Dont depend on win32api in polyglot 2019-06-10 18:21:38 +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
ee97edc94d
Merge branch 'calibre-complete' of https://github.com/eli-schwartz/calibre 2019-05-20 06:31:45 +05:30
Eli Schwartz
09b4218b83
py3: recursive forcing to unicode missed converting set()
This resulted in e.g. ebook-convert-complete still storing most formats
in msgpack as bytestrings, and therefore not being completed.
2019-05-19 14:34:47 -04:00
Kovid Goyal
a08bdbeb4e
Dont depend on calibre in polyglot 2019-05-15 16:42:52 +05:30
Kovid Goyal
a78ede4c35
py3: Port constants.py to use unicode literals 2019-05-15 15:49:22 +05:30
Kovid Goyal
a2fa719545
Better naming 2019-04-29 21:29:47 +05:30
Kovid Goyal
1744a2b2fd
Micro-optimization 2019-04-29 21:27:14 +05:30
Kovid Goyal
05816c2c85
oops 2019-04-29 21:02:31 +05:30
Kovid Goyal
ed2e2e060f
Ensure completion dict for ebook-convert has unicode strings 2019-04-29 20:48:52 +05:30
Kovid Goyal
23f22906b3
py3: Fix failure in Unhandled exception handler 2019-04-17 19:44:28 +05:30
Kovid Goyal
03df438219
py3: Port bytes() 2019-04-15 19:48:42 +05:30
Kovid Goyal
b177f0a109
Nicer fix for lru_cache() that does not require meta_path trickery 2019-04-13 10:01:46 +05:30
Kovid Goyal
79f5a6c18b
Add lru_cache() to polyglot
I decided to vendor the implementation from
https://raw.githubusercontent.com/jaraco/backports.functools_lru_cache/master/backports/functools_lru_cache.py

as it depends on setuptools_scm installing which is failing on the macOS
build machine with SSL errors that I cant be bothered to track down. Not
to mention that installing a an extra dependency just for a single
function is absurd.
2019-04-13 09:42:27 +05:30
Kovid Goyal
13961abd16
Also check python files using python 3 flake8 2019-04-13 09:17:31 +05:30
Kovid Goyal
1a602a7873
py3: Port urlunquote
Also take the opportunity to make unquote correct on python 2 by moving
urlunquote to the polyglot module
2019-04-10 20:53:01 +05:30
Kovid Goyal
fd307c5eee
py3: port smtplib 2019-04-04 13:27:56 +05:30
Kovid Goyal
3c64ea0995
py3: Port terminal I/O module 2019-04-03 14:28:51 +05:30
Kovid Goyal
152689812a
py3: Port use of Exception.message 2019-04-02 15:04:26 +05:30
Kovid Goyal
ce007d8bab
py3: port plistlib 2019-04-01 16:05:31 +05:30
Kovid Goyal
8b280c03c3
py3: Port RTF metadata module 2019-03-31 13:45:46 +05:30
Kovid Goyal
f149427104
py3: Port use of (un)hexlify() 2019-03-30 14:34:48 +05:30
Kovid Goyal
fcd5700306
py3: port use as base64 module 2019-03-30 13:01:47 +05:30
Kovid Goyal
0db9c42360
Use a polyglot IO class for device debug output 2019-03-28 12:20:13 +05:30
Kovid Goyal
57e11977b7
py3: get rid of __cmp__ 2019-03-28 11:24:37 +05:30
Eli Schwartz
9023ea8947
python3: add Cookie wrapper to polyglot 2019-03-26 16:12:18 -04:00
Eli Schwartz
564f053c02
python3: add reprlib wrapper to polyglot 2019-03-26 15:49:40 -04:00
Eli Schwartz
727e65a203
python3: add httplib/http.client polyglot wrapper 2019-03-26 15:49:39 -04:00
Eli Schwartz
d7410fe7b3
python3: add polyglot wrapper for html.entities/htmlentitydefs 2019-03-26 15:10:40 -04:00
Kovid Goyal
0aee163cf7
... 2019-03-26 18:03:17 +05:30
Kovid Goyal
e1c7ab579d
... 2019-03-26 14:53:32 +05:30
Kovid Goyal
1fed6604e0
py3: port use of raw_input 2019-03-26 14:45:36 +05:30
Kovid Goyal
d9ab752f94
DRYer 2019-03-25 18:54:01 +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
Eli Schwartz
45f68f552b
python3: make coffee build
add polyglot.socketserver wrapper and fix BaseHTTPServer.HTTPServer
2019-03-21 01:27:21 -04:00
Kovid Goyal
9386839320
Various ixes for the previous polyglot commit 2019-03-20 21:11:45 +05:30
Eli Schwartz
83b055122a
python3: add polyglot.queue wrapper 2019-03-20 08:44:23 -04:00
Eli Schwartz
8594f52fe8
python3: add more urllib wrappers 2019-03-20 08:43:54 -04:00
Kovid Goyal
dc274d8c1c
Use ABC to test for numbers type
This is important as long does not exist on py3 and anyway using an ABC
is more robust.  Also fix a few uses of long() for py3.
2019-03-16 12:17:14 +05:30
Kovid Goyal
dbcb63c290
Ensure worker env keys are bytes/unicodeon py2/3 2019-03-15 21:45:54 +05:30
Kovid Goyal
55151a3cdd
Get rid of basestring 2019-03-13 14:57:26 +05:30
Kovid Goyal
5b76089839
Various py3 related fixes exposed by the unicode patch 2019-03-13 06:41:39 +05:30
Eli Schwartz
cbc42bec23
python3: add unicode/unichr wrappers to polyglot 2019-03-13 06:41:38 +05:30
Eli Schwartz
8e853a3ff8 python3: add polyglot compat layer for builtins / __builtin__ 2019-02-20 23:05:04 -05:00
Kovid Goyal
f17173e615
Add Request to plyglot 2018-10-03 06:50:03 +05:30
Kovid Goyal
f39f3951f4
dict fixes in the setup package 2018-09-10 20:54:35 +05:30