29984 Commits

Author SHA1 Message Date
Charles Haley
8281ab4318 Bug #1842158: fix regression in commit <b8b5c4e> 25 July 2019 08:52:35. 2019-08-31 11:54:12 +01:00
Kovid Goyal
5dad6c60ee
Fix a regression that broke restarting calibre on macOS 2019-08-31 14:04:17 +05:30
Kovid Goyal
20486dd0a3
Remove unused code 2019-08-31 08:21:42 +05:30
Kovid Goyal
1156e8209a
Book details: Fix a regression in the previous release that broke the right click search the internet function
Fixes #1842090 ["Search the internet for..." right-click options fail](https://bugs.launchpad.net/calibre/+bug/1842090)
2019-08-30 20:57:05 +05:30
Kovid Goyal
05834f0b42
PDF Input: Fix < and > in the text not being correctly handled 2019-08-30 08:03:08 +05:30
Kovid Goyal
b0fe64571e
Fix regex for py3 2019-08-30 07:56:18 +05:30
Kovid Goyal
260c330da3
pep8 2019-08-30 06:41:15 +05:30
Kovid Goyal
9796c9f80c
version 3.47.0 2019-08-30 06:35:07 +05:30
Kovid Goyal
85ccc7bdfc
Dont pass on requests to open executables to the OS from ebooks/metadata
This is because some OSes (windows) actually launch these executables
without asking the user
2019-08-29 20:15:00 +05:30
Kovid Goyal
9cf6125f19
misc fixes from last py3 merge 2019-08-29 18:20:49 +05:30
Kovid Goyal
da5b6f898f
... 2019-08-29 13:18:18 +05:30
Eli Schwartz
b4dfa7378f
py3: more work toward universal __future__s 2019-08-28 16:57:11 -04:00
Eli Schwartz
cf24ed3d00
misc cleanup set([]) 2019-08-28 16:57:11 -04:00
Eli Schwartz
d12af03e00
__future__.unicode_literals: don't use r'C:\U' as python2 dislikes it
You get this instead:

SyntaxError: (unicode error) 'rawunicodeescape' codec can't decode bytes in position 2-3: truncated \uXXXX

It does work fine in python3 with native unicode str()
2019-08-28 16:57:11 -04:00
Eli Schwartz
dde0e3cd9d
py3: make sure division is really floored 2019-08-28 16:57:11 -04:00
Eli Schwartz
c9f8ffedb1
micro-optimization: sorted() can take any iterable and returns a list
So there is no need to convert everything to lists before and after.
Also, all_formats is immediately converted to a set, and kept that way,
so it does not need to always be accessed as set(all_formats).
2019-08-28 16:57:11 -04:00
Eli Schwartz
04a37cdf3b
simplify building list of input/output formats
QComboBox.addItems() accepts any iterable, and there's no reason to use
map plus a list comprehension to operate on the same data.

- input_formats will currently be lowercase, output_formats is uppercase.
  Without documenting this inconsistent internal API, don't rely on it.

- While all builtin output plugins should have unicode_literals compatible
  file_type attributes, at least this assumption might break for custom
  plugins, so continue mapping to unicode_type.

Well, at least we can reduce the number of allocated lists.
2019-08-28 16:57:11 -04:00
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
Kovid Goyal
60c0290e1c
py3 compat: Fix right clicking in file list not working 2019-08-24 07:32:00 +05:30
Kovid Goyal
6b448bf935
misc fixes for previous py3 merge 2019-08-21 20:57:06 +05:30
Kovid Goyal
9c49e000d1
... 2019-08-21 20:48:18 +05:30
Kovid Goyal
179d5812b1
More set([]) -> set() 2019-08-21 20:44:14 +05:30
Kovid Goyal
967006043b
Dont use > to test for non-empty strings 2019-08-21 19:56:30 +05:30
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
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
ac9f1fc2d9
change wording slightly 2019-08-14 08:50:06 +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