Commit Graph

68 Commits

Author SHA1 Message Date
Kovid Goyal 2b5b422301 Allow enabling indexing from the server 2022-12-12 21:37:40 +05:30
Zbigniew Jędrzejewski-Szmek 9d63b6ae56 Drop (object) from class definitions
Python2 had old-style classes (no "(object)"), and new style classes (with
"object"). Under Py3 this is a noop, so let's drop it to make the code
a bit shorter.
2021-09-30 09:23:56 +02:00
Đoàn Trần Công Danh 238680060c polyglot: don't try to import plistlib.Data
plistlib.Data is deprecated from Python 3.4 and fully removed in Python
3.9.

Skimming over the code, it's look like nothing uses this data structure.

Let's remove it.
2020-11-02 07:17:07 +07:00
Kovid Goyal 4ab24b8ea2 Remove wrap/unwrap for bytes in plistlib not needed on py3 2020-08-22 18:48:08 +05:30
Kovid Goyal 520adcafc0 ... 2020-08-22 18:48:06 +05:30
Kovid Goyal 01b0fba8ad Auto fix excess blank lines 2020-08-22 18:47:56 +05:30
Kovid Goyal 520c46dfb9 Minor fixups for changes when removing py3 conditionals 2020-08-22 18:47:56 +05:30
Kovid Goyal 764e8bff7e Remove py3 conditionals 2020-08-22 18:47:56 +05:30
Kovid Goyal 36d81d74d5 Remove hardcoding of mbcs for filesystem names 2020-08-22 18:47:55 +05:30
Kovid Goyal 9ff27782de Remove useless __future__ imports
Not needed on python3
2020-08-22 18:47:55 +05:30
Kovid Goyal 29cd8d64ea Change shebangs to python from python2
Also remove a few other miscellaneous references to python2
2020-08-22 18:47:51 +05:30
Kovid Goyal 5b2baa7233 Fix for plistlib dropping Data in python 3.9
Fixes #1184 (plistlib.Data is going to be dropped in python 3.9)
2020-07-02 08:42:18 +05:30
Kovid Goyal ac5b5c9957 Dont put biplist in backports 2020-04-21 22:49:45 +05:30
Kovid Goyal b9082d95dc macOS: Fix selecting applications that use binary plist files such as Kindle.app with Open With not working. Fixes #1873972 [Callibre not letting me open mobi file in Kindle](https://bugs.launchpad.net/calibre/+bug/1873972) 2020-04-21 21:12:33 +05:30
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