Commit Graph

37953 Commits

Author SHA1 Message Date
Eli Schwartz adcc2c5539 install: fix calibre-uninstall relying on the source tree
Injecting the location of the mime_resources file from P() in non-frozen
builds will depend on the mime resource from the source tree rather than
the same location during install time... a source tree which may be
deleted after successful installation. On a frozen build, or when using
'develop' instead of 'install', this path will be the same, and things
just work.

The solution is to add *both* paths, and try to uninstall whichever one
exists.
2019-05-12 18:14:42 -04:00
Eli Schwartz 2a63948440 install: when using a staging root, setup XDG_DATA_DIRS magic
In order for xdg-utils programs to successfully install resources to the
staging root instead of /usr, this variable needs to be set and
additionally some arcane directories must be created that xdg-utils,
astoundingly, does not know how to just gracefully handle.

xdg-mime is simply hopeless as it does not have a --noupdate flag. When
using a staged install, copy it with shutil instead.
2019-05-12 18:14:42 -04:00
Kovid Goyal 61eef65bb6 Merge branch 'git_version' of https://github.com/eli-schwartz/calibre 2019-05-12 12:45:16 +05:30
Eli Schwartz 9dc1ccfe08 setup: add subcommand to update the version in constants.py from git
This creates an additional variable containing the version number
extracted from a git checkout via `git describe`, and diverts all
human-readable output to use that via get_version.
2019-05-12 02:32:59 -04:00
Kovid Goyal e3c889b10d Merge branch 'py3' of https://github.com/eli-schwartz/calibre 2019-05-12 11:08:35 +05:30
Eli Schwartz dc96af5763 py3: textwrap.dedent requires unicode strings, encode after the fact
Also all the format arguments are unicode strings, *and* in the wisdom
of python3, you can % format a bytestring but not .format() it.
2019-05-12 01:17:13 -04:00
Eli Schwartz aa8efc504d py3: make user auth work; don't mess with encodings for strftime
The Windows-specific hack initially added in commit
8743efbed1 should be able to be removed
now as it is no longer necessary. The python encoding on Windows is sane
in python3.
2019-05-12 01:17:13 -04:00
Eli Schwartz ba0a4992b6 py3: save server preferences using bytestrings 2019-05-12 01:17:13 -04:00
Eli Schwartz 457eea7407 py3: use correct __next__ method
I'm not sure why this is storing a seemingly unused method-wrapper
object, but it needs to use the correctly named one on python2/python3.
2019-05-12 01:17:13 -04:00
Eli Schwartz aa44bf1cd1 py3: hashlib .hexdigest() always returns a hexadecimal string
This is a subset of ascii and cannot be decoded.
2019-05-12 01:17:13 -04:00
Kovid Goyal 2cb8f6b076 py3: misc fixes 2019-05-11 08:12:25 +05:30
Kovid Goyal 9bc4d1d375 Merge branch 'master' of https://github.com/davidfor/calibre 2019-05-09 17:16:08 +05:30
David f7b0190b45 Bump supported Kobo firmware version
No changes needed except the supported firmware and database versions.
2019-05-09 21:21:48 +10:00
Kovid Goyal 96429111a1 Fix a regression in get_trnaslator
d1f94b510c meant that English null translator was not being returned for
lang when language included country code.
2019-05-09 16:17:12 +05:30
Kovid Goyal 87b54360f3 oops 2019-05-07 08:35:21 +05:30
Kovid Goyal 1dce5118b9 Merge branch 'toolbar-sort' of https://github.com/eli-schwartz/calibre 2019-05-07 07:55:18 +05:30
Eli Schwartz 1c23908049 preferences: fix sort order when moving an action out of the toolbar
The sort() call is operating on objects that have no comparison
functions and span multiple types, so they were always compared by their
hash(). This resulted in adding an action, then removing it, causing the
entire "Available Actions" box to be sorted seemingly at random.

This was uncovered during python3 porting, as the objects cannot be
compared at all and therefore return errors.

The default sort order (before anything is done) is to sort based on
pretty names, and therefore use this as the sort key when re-sorting.
2019-05-06 22:08:24 -04:00
Kovid Goyal b0591e5f60 Merge branch 'py3' of https://github.com/eli-schwartz/calibre 2019-05-07 07:27:42 +05:30
Eli Schwartz 8e773ae855 py3: fix metadata panel showing roman series numbers
python3 zip() is depleted the first time you use it, but this will need
to be used many times.
2019-05-06 17:17:34 -04:00
Kovid Goyal 0b79aa763c Add some deps to Linux chroot for Qt 2019-05-06 11:57:09 +05:30
Kovid Goyal 56036fd77a bypy based linux freeze works 2019-05-05 14:10:03 +05:30
Kovid Goyal 6aad4c495e Nicer error messages when import Qt modules fail in the build tests 2019-05-05 14:09:19 +05:30
Kovid Goyal 82e6a3937a More work on porting Linux freeze 2019-05-05 10:09:57 +05:30
Kovid Goyal 01198cf010 Work on porting the calibre linux freeze script 2019-05-05 07:16:35 +05:30
Kovid Goyal a1c943c1e0 For some reason the redirect for the boston globe is not working in mechanize 2019-05-03 19:35:18 +05:30
Kovid Goyal 0238ae739b Update more deps 2019-05-03 12:48:56 +05:30
Kovid Goyal 9709efaba9 Prevent errors in tweaks.py from preventing calibre startup 2019-05-03 06:44:08 +05:30
Kovid Goyal 28a07b0727 py3 compat 2019-05-02 15:18:41 +05:30
Kovid Goyal 52c7621484 Merge branch 'master' of https://github.com/cbhaley/calibre 2019-05-02 15:16:19 +05:30
Kovid Goyal 8b858d5c00 Update deps 2019-05-02 15:06:28 +05:30
Charles Haley e8afb87d9d Fix problem when CC accesses the content server with the option device_for_template. Fixes exception
Traceback (most recent call last):
  File "C:\CBH_Data\calibre.git\calibre_dev\src\calibre\srv\ajax.py", line 141, in book_to_json
  File "C:\CBH_Data\calibre.git\calibre_dev\src\calibre\devices\utils.py", line 98, in create_upload_path
  File "C:\CBH_Data\calibre.git\calibre_dev\src\calibre\utils\filenames.py", line 40, in ascii_filename
  File "C:\CBH_Data\calibre.git\calibre_dev\src\calibre\utils\filenames.py", line 30, in ascii_text
AttributeError: 'int' object has no attribute 'decode'
2019-05-02 10:27:53 +01:00
Kovid Goyal 1c22094803 Cleanup urllib imports 2019-05-02 07:25:03 +05:30
Kovid Goyal d6402a0fdd Use a non-deprecated technique for resuming partial downloads in the Linux installer. Fixes #1827289 [Deprecation warning in installation script.](https://bugs.launchpad.net/calibre/+bug/1827289) 2019-05-02 07:17:44 +05:30
Kovid Goyal bc9ac66ae2 Merge branch 'py3' of https://github.com/eli-schwartz/calibre 2019-05-01 21:02:19 +05:30
Eli Schwartz 4a49ea4352 py3: make column rules editor work
The sort key grades each string as a bytestring, so falling back on an
integer is incorrect.
2019-05-01 11:23:27 -04:00
Eli Schwartz d9918b5b9c py3: make cover grid texture selection work
map() is an iterable, so using it as a shortcut for a proper for loop in
order to apply functions, is no longer valid.

Also move from the long deprecated string.*() functions -- which no
longer exist in python3 -- that are better dealt with through the native
str/unicode type methods.
2019-05-01 11:23:27 -04:00
Kovid Goyal 9714f722e7 Fix metadata download form Amazon stripping accents from comments text in the binary builds
Seems to be caused by a bug in the lxml version in the builds, which
causes it to output unicode chars as entities, which in turn were
getting stripped by the sanitize_html() function. Fixes #1825905 [amazon scrapper not retrieving accented caracters](https://bugs.launchpad.net/calibre/+bug/1825905)
2019-05-01 19:04:12 +05:30
Kovid Goyal ad9627f14a py3: Mix fixes 2019-05-01 18:51:09 +05:30
Kovid Goyal 6f355b5297 py3: fix sorting dictionaries when some of their names might be None 2019-05-01 17:25:34 +05:30
Kovid Goyal 1473f4a83e Forgot to remove unused dot object 2019-05-01 17:14:05 +05:30
Kovid Goyal d324e776b5 Greatly simplify unicode_to_number
This also has the virtue of making number parsing locale independent, as
is required for parsing CSS literals
2019-05-01 17:10:21 +05:30
Kovid Goyal 3de9c83787 pep8 2019-05-01 16:42:43 +05:30
Kovid Goyal 2ed54d1782 Make the db and server tests locale independent 2019-05-01 16:31:02 +05:30
Kovid Goyal d1f94b510c Fix translator for English not being returned on other locales 2019-05-01 14:34:05 +05:30
Kovid Goyal b018850f24 Update Boston Globe Subscription 2019-05-01 13:31:43 +05:30
Kovid Goyal 7f099475b2 Fix bing search query parser to work with mobile UAs 2019-04-30 17:51:24 +05:30
Kovid Goyal b9c781b5e0 py3: Port some remaining uses of has_key() 2019-04-30 17:24:05 +05:30
Kovid Goyal a31151e864 Amazon metadata download: Fix some downloads failing when a mobile user agent is randomnly selected. Fixes #1827027 [meta data request to amazon failed for some user agents](https://bugs.launchpad.net/calibre/+bug/1827027)
Amazon serves up different markup to mobile browsers, so ensure we dont
use them.
2019-04-30 16:59:08 +05:30
Kovid Goyal e6fd5e4c0c Fix some mobile user agents not being filtered out from random_user_agent 2019-04-30 16:34:03 +05:30
Kovid Goyal 30232ebd52 py3: Port LRF Output 2019-04-30 16:11:56 +05:30