From 887f62040629cafb55af80092a4b295208e7a624 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 17 Oct 2021 17:09:54 -0400 Subject: [PATCH] py3 porting cleanup: remove unneeded indirect import of builtins filter, map, range, and zip were proxied through polyglot.builtins to ensure that their `future_builtins` forms were used. In python3 this is no longer needed and they don't need to be imported at all, from anywhere. So, don't. --- setup/browser_data.py | 1 - setup/translations.py | 2 +- src/calibre/__init__.py | 2 +- src/calibre/constants.py | 2 +- src/calibre/customize/profiles.py | 1 - src/calibre/customize/zipplugin.py | 2 +- src/calibre/db/__init__.py | 2 +- src/calibre/db/adding.py | 4 ++-- src/calibre/db/cache.py | 4 +--- src/calibre/db/categories.py | 2 +- src/calibre/db/cli/cmd_list.py | 2 +- src/calibre/db/cli/cmd_list_categories.py | 2 +- src/calibre/db/cli/utils.py | 2 -- src/calibre/db/legacy.py | 2 +- src/calibre/db/restore.py | 2 +- src/calibre/db/tables.py | 2 +- src/calibre/db/tests/base.py | 2 +- src/calibre/db/tests/legacy.py | 2 +- src/calibre/db/tests/locking.py | 1 - src/calibre/db/tests/reading.py | 2 +- src/calibre/db/utils.py | 2 +- src/calibre/db/view.py | 3 +-- src/calibre/db/write.py | 2 +- src/calibre/devices/__init__.py | 2 +- src/calibre/devices/cybook/t4b.py | 1 - src/calibre/devices/jetbook/driver.py | 2 +- src/calibre/devices/kindle/apnx.py | 2 +- src/calibre/devices/mtp/driver.py | 2 +- src/calibre/devices/mtp/filesystem_cache.py | 2 +- src/calibre/devices/mtp/test.py | 1 - src/calibre/devices/mtp/windows/driver.py | 2 +- src/calibre/devices/prs505/sony_cache.py | 2 +- src/calibre/devices/scanner.py | 1 - src/calibre/devices/usbms/device.py | 2 +- src/calibre/devices/usbms/driver.py | 2 +- src/calibre/devices/winusb.py | 2 +- src/calibre/ebooks/comic/input.py | 2 +- src/calibre/ebooks/compression/palmdoc.py | 1 - src/calibre/ebooks/compression/tcr.py | 2 +- src/calibre/ebooks/conversion/plugins/comic_input.py | 2 +- src/calibre/ebooks/conversion/plugins/epub_output.py | 2 +- src/calibre/ebooks/conversion/plugins/html_input.py | 2 +- src/calibre/ebooks/conversion/plugins/rtf_input.py | 2 +- src/calibre/ebooks/conversion/plumber.py | 2 +- src/calibre/ebooks/conversion/preprocess.py | 2 +- src/calibre/ebooks/covers.py | 2 +- src/calibre/ebooks/djvu/djvubzzdec.py | 1 - src/calibre/ebooks/docx/cleanup.py | 2 +- src/calibre/ebooks/docx/fonts.py | 2 +- src/calibre/ebooks/docx/index.py | 2 +- src/calibre/ebooks/docx/tables.py | 2 +- src/calibre/ebooks/docx/to_html.py | 2 +- src/calibre/ebooks/docx/toc.py | 2 +- src/calibre/ebooks/docx/writer/container.py | 2 +- src/calibre/ebooks/docx/writer/fonts.py | 1 - src/calibre/ebooks/docx/writer/images.py | 2 +- src/calibre/ebooks/docx/writer/styles.py | 2 +- src/calibre/ebooks/docx/writer/tables.py | 2 +- src/calibre/ebooks/epub/cfi/parse.py | 1 - src/calibre/ebooks/epub/cfi/tests.py | 1 - src/calibre/ebooks/epub/periodical.py | 2 +- src/calibre/ebooks/fb2/fb2ml.py | 2 +- src/calibre/ebooks/lit/maps/opf.py | 1 - src/calibre/ebooks/lit/mssha1.py | 2 +- src/calibre/ebooks/lit/reader.py | 2 +- src/calibre/ebooks/lit/writer.py | 2 +- src/calibre/ebooks/lrf/html/table.py | 2 +- src/calibre/ebooks/lrf/input.py | 2 +- src/calibre/ebooks/metadata/__init__.py | 2 +- src/calibre/ebooks/metadata/archive.py | 2 +- src/calibre/ebooks/metadata/author_mapper.py | 2 +- src/calibre/ebooks/metadata/book/base.py | 2 +- src/calibre/ebooks/metadata/book/render.py | 1 - src/calibre/ebooks/metadata/kdl.py | 2 +- src/calibre/ebooks/metadata/kfx.py | 2 +- src/calibre/ebooks/metadata/mobi.py | 2 +- src/calibre/ebooks/metadata/opf2.py | 2 +- src/calibre/ebooks/metadata/opf3.py | 2 +- src/calibre/ebooks/metadata/plucker.py | 1 - src/calibre/ebooks/metadata/rtf.py | 2 +- src/calibre/ebooks/metadata/tag_mapper.py | 2 +- src/calibre/ebooks/metadata/utils.py | 1 - src/calibre/ebooks/metadata/xmp.py | 2 +- src/calibre/ebooks/mobi/debug/containers.py | 2 +- src/calibre/ebooks/mobi/debug/headers.py | 2 +- src/calibre/ebooks/mobi/debug/index.py | 2 +- src/calibre/ebooks/mobi/debug/mobi6.py | 2 +- src/calibre/ebooks/mobi/debug/mobi8.py | 2 +- src/calibre/ebooks/mobi/huffcdic.py | 1 - src/calibre/ebooks/mobi/reader/index.py | 2 +- src/calibre/ebooks/mobi/reader/mobi6.py | 2 +- src/calibre/ebooks/mobi/reader/mobi8.py | 2 +- src/calibre/ebooks/mobi/utils.py | 2 +- src/calibre/ebooks/mobi/writer2/indexer.py | 2 +- src/calibre/ebooks/mobi/writer2/main.py | 2 +- src/calibre/ebooks/mobi/writer8/index.py | 4 +--- src/calibre/ebooks/odt/input.py | 2 +- src/calibre/ebooks/oeb/base.py | 2 +- src/calibre/ebooks/oeb/iterator/spine.py | 2 +- src/calibre/ebooks/oeb/normalize_css.py | 2 +- src/calibre/ebooks/oeb/parse_utils.py | 2 +- src/calibre/ebooks/oeb/polish/check/base.py | 1 - src/calibre/ebooks/oeb/polish/check/links.py | 2 +- src/calibre/ebooks/oeb/polish/check/main.py | 2 +- src/calibre/ebooks/oeb/polish/container.py | 2 +- src/calibre/ebooks/oeb/polish/css.py | 2 +- src/calibre/ebooks/oeb/polish/embed.py | 1 - src/calibre/ebooks/oeb/polish/fonts.py | 2 +- src/calibre/ebooks/oeb/polish/images.py | 2 +- src/calibre/ebooks/oeb/polish/pretty.py | 2 +- src/calibre/ebooks/oeb/polish/replace.py | 2 +- src/calibre/ebooks/oeb/polish/spell.py | 2 +- src/calibre/ebooks/oeb/polish/split.py | 2 +- src/calibre/ebooks/oeb/polish/stats.py | 2 +- src/calibre/ebooks/oeb/polish/tests/parsing.py | 2 +- src/calibre/ebooks/oeb/polish/toc.py | 2 +- src/calibre/ebooks/oeb/polish/utils.py | 1 - src/calibre/ebooks/oeb/reader.py | 2 +- src/calibre/ebooks/oeb/stylizer.py | 2 +- src/calibre/ebooks/oeb/transforms/flatcss.py | 2 +- src/calibre/ebooks/oeb/transforms/jacket.py | 2 +- src/calibre/ebooks/oeb/transforms/split.py | 2 +- src/calibre/ebooks/oeb/transforms/subset.py | 2 +- src/calibre/ebooks/pdb/ereader/reader132.py | 2 +- src/calibre/ebooks/pdb/ereader/reader202.py | 2 +- src/calibre/ebooks/pdb/haodoo/reader.py | 1 - src/calibre/ebooks/pdb/pdf/reader.py | 1 - src/calibre/ebooks/pdb/plucker/reader.py | 2 +- src/calibre/ebooks/pdf/html_writer.py | 2 +- src/calibre/ebooks/pdf/reflow.py | 1 - src/calibre/ebooks/pdf/render/fonts.py | 2 +- src/calibre/ebooks/pdf/render/gradients.py | 1 - src/calibre/ebooks/pdf/render/serialize.py | 2 +- src/calibre/ebooks/pml/__init__.py | 1 - src/calibre/ebooks/rb/reader.py | 2 +- src/calibre/ebooks/rtf2xml/tokenize.py | 2 +- src/calibre/ebooks/txt/processor.py | 2 +- src/calibre/ebooks/unihandecode/pykakasi/h2a.py | 3 --- src/calibre/ebooks/unihandecode/pykakasi/k2a.py | 1 - src/calibre/gui2/__init__.py | 4 +--- src/calibre/gui2/actions/add.py | 2 +- src/calibre/gui2/actions/annotate.py | 2 +- src/calibre/gui2/actions/author_mapper.py | 2 +- src/calibre/gui2/actions/catalog.py | 1 - src/calibre/gui2/actions/choose_library.py | 2 +- src/calibre/gui2/actions/edit_metadata.py | 2 +- src/calibre/gui2/actions/polish.py | 2 +- src/calibre/gui2/actions/save_to_disk.py | 2 +- src/calibre/gui2/actions/tag_mapper.py | 2 +- src/calibre/gui2/add.py | 2 +- src/calibre/gui2/add_filters.py | 2 +- src/calibre/gui2/auto_add.py | 1 - src/calibre/gui2/bars.py | 2 +- src/calibre/gui2/catalog/catalog_bibtex.py | 2 +- src/calibre/gui2/catalog/catalog_csv_xml.py | 2 +- src/calibre/gui2/catalog/catalog_epub_mobi.py | 2 +- src/calibre/gui2/comments_editor.py | 2 +- src/calibre/gui2/convert/heuristics.py | 2 +- src/calibre/gui2/convert/regex_builder.py | 2 +- src/calibre/gui2/convert/search_and_replace.py | 2 +- src/calibre/gui2/convert/xpath_wizard.py | 2 +- src/calibre/gui2/device_drivers/mtp_config.py | 2 +- src/calibre/gui2/device_drivers/mtp_folder_browser.py | 2 +- src/calibre/gui2/device_drivers/tabbed_device_config.py | 2 +- src/calibre/gui2/dialogs/add_from_isbn.py | 2 +- src/calibre/gui2/dialogs/authors_edit.py | 2 +- src/calibre/gui2/dialogs/custom_recipes.py | 2 +- src/calibre/gui2/dialogs/duplicates.py | 2 +- src/calibre/gui2/dialogs/exim.py | 1 - src/calibre/gui2/dialogs/metadata_bulk.py | 4 +--- src/calibre/gui2/dialogs/plugin_updater.py | 2 +- src/calibre/gui2/dialogs/scheduler.py | 2 +- src/calibre/gui2/dialogs/search.py | 2 +- src/calibre/gui2/dialogs/smartdevice.py | 2 +- src/calibre/gui2/dialogs/tag_editor.py | 2 +- src/calibre/gui2/font_family_chooser.py | 2 +- src/calibre/gui2/icon_theme.py | 2 +- src/calibre/gui2/job_indicator.py | 1 - src/calibre/gui2/jobs.py | 1 - src/calibre/gui2/keyboard.py | 2 +- src/calibre/gui2/library/alternate_views.py | 2 +- src/calibre/gui2/library/models.py | 4 +--- src/calibre/gui2/library/views.py | 2 +- src/calibre/gui2/main.py | 2 +- src/calibre/gui2/metadata/basic_widgets.py | 2 +- src/calibre/gui2/metadata/diff.py | 2 +- src/calibre/gui2/metadata/single.py | 2 +- src/calibre/gui2/metadata/single_download.py | 2 +- src/calibre/gui2/open_with.py | 2 +- src/calibre/gui2/pin_columns.py | 1 - src/calibre/gui2/preferences/behavior.py | 2 +- src/calibre/gui2/preferences/columns.py | 2 +- src/calibre/gui2/preferences/create_custom_column.py | 2 +- src/calibre/gui2/preferences/emailp.py | 2 +- src/calibre/gui2/preferences/ignored_devices.py | 2 +- src/calibre/gui2/preferences/look_feel.py | 2 +- src/calibre/gui2/preferences/texture_chooser.py | 2 +- src/calibre/gui2/preferences/tweaks.py | 2 +- src/calibre/gui2/search_box.py | 2 +- src/calibre/gui2/store/config/chooser/adv_search_builder.py | 2 +- src/calibre/gui2/store/config/chooser/models.py | 2 +- src/calibre/gui2/store/config/chooser/results_view.py | 1 - src/calibre/gui2/store/search/download_thread.py | 1 - src/calibre/gui2/tag_browser/model.py | 2 +- src/calibre/gui2/tag_browser/view.py | 2 +- src/calibre/gui2/tag_mapper.py | 2 +- src/calibre/gui2/toc/location.py | 2 +- src/calibre/gui2/toc/main.py | 2 +- src/calibre/gui2/tweak_book/__init__.py | 2 +- src/calibre/gui2/tweak_book/boss.py | 4 +--- src/calibre/gui2/tweak_book/char_select.py | 2 +- src/calibre/gui2/tweak_book/check.py | 2 +- src/calibre/gui2/tweak_book/diff/highlight.py | 2 +- src/calibre/gui2/tweak_book/diff/main.py | 2 +- src/calibre/gui2/tweak_book/diff/view.py | 2 +- src/calibre/gui2/tweak_book/download.py | 2 +- src/calibre/gui2/tweak_book/editor/snippets.py | 4 +--- src/calibre/gui2/tweak_book/editor/text.py | 2 +- src/calibre/gui2/tweak_book/editor/themes.py | 2 +- src/calibre/gui2/tweak_book/file_list.py | 2 +- src/calibre/gui2/tweak_book/preferences.py | 3 +-- src/calibre/gui2/tweak_book/reports.py | 2 +- src/calibre/gui2/tweak_book/search.py | 4 +--- src/calibre/gui2/tweak_book/spell.py | 2 +- src/calibre/gui2/tweak_book/toc.py | 2 +- src/calibre/gui2/tweak_book/ui.py | 2 +- src/calibre/gui2/tweak_book/widgets.py | 3 +-- src/calibre/gui2/update.py | 2 +- src/calibre/gui2/viewer/bookmarks.py | 2 +- src/calibre/gui2/viewer/highlights.py | 1 - src/calibre/gui2/viewer/search.py | 2 +- src/calibre/gui2/widgets.py | 2 +- src/calibre/gui2/win_file_dialogs.py | 2 +- src/calibre/gui2/wizard/__init__.py | 2 +- src/calibre/library/__init__.py | 1 - src/calibre/library/caches.py | 3 +-- src/calibre/library/catalogs/bibtex.py | 2 +- src/calibre/library/catalogs/epub_mobi_builder.py | 2 +- src/calibre/library/check_library.py | 2 +- src/calibre/library/coloring.py | 1 - src/calibre/library/database.py | 2 +- src/calibre/library/database2.py | 2 +- src/calibre/library/restore.py | 2 +- src/calibre/ptempfile.py | 2 +- src/calibre/spell/dictionary.py | 2 +- src/calibre/srv/ajax.py | 2 +- src/calibre/srv/books.py | 2 +- src/calibre/srv/changes.py | 3 --- src/calibre/srv/content.py | 2 +- src/calibre/srv/handler.py | 2 +- src/calibre/srv/http_request.py | 2 +- src/calibre/srv/http_response.py | 2 +- src/calibre/srv/legacy.py | 2 +- src/calibre/srv/manage_users_cli.py | 2 +- src/calibre/srv/metadata.py | 2 +- src/calibre/srv/opds.py | 2 +- src/calibre/srv/pool.py | 1 - src/calibre/srv/render_book.py | 2 +- src/calibre/srv/routes.py | 2 +- src/calibre/srv/tests/auth.py | 2 +- src/calibre/srv/tests/http.py | 2 +- src/calibre/srv/tests/loop.py | 2 +- src/calibre/srv/tests/routes.py | 2 +- src/calibre/srv/tests/web_sockets.py | 2 +- src/calibre/srv/utils.py | 2 +- src/calibre/test_build.py | 2 +- src/calibre/utils/cleantext.py | 2 +- src/calibre/utils/config_base.py | 2 +- src/calibre/utils/filenames.py | 2 +- src/calibre/utils/fonts/free_type.py | 2 +- src/calibre/utils/fonts/metadata.py | 2 +- src/calibre/utils/fonts/scanner.py | 2 +- src/calibre/utils/fonts/sfnt/cff/dict_data.py | 2 +- src/calibre/utils/fonts/sfnt/cff/table.py | 2 +- src/calibre/utils/fonts/sfnt/cff/writer.py | 1 - src/calibre/utils/fonts/sfnt/cmap.py | 1 - src/calibre/utils/fonts/sfnt/common.py | 2 +- src/calibre/utils/fonts/sfnt/head.py | 1 - src/calibre/utils/fonts/sfnt/kern.py | 1 - src/calibre/utils/fonts/sfnt/loca.py | 2 +- src/calibre/utils/fonts/sfnt/maxp.py | 1 - src/calibre/utils/fonts/sfnt/metrics.py | 2 +- src/calibre/utils/fonts/sfnt/subset.py | 2 +- src/calibre/utils/fonts/utils.py | 2 +- src/calibre/utils/icu.py | 2 +- src/calibre/utils/matcher.py | 2 +- src/calibre/utils/open_with/windows.py | 1 - src/calibre/utils/rapydscript.py | 2 +- src/calibre/utils/terminal.py | 2 +- src/calibre/utils/zipfile.py | 2 +- src/calibre/web/feeds/__init__.py | 2 +- src/calibre/web/feeds/recipes/__init__.py | 2 +- src/css_selectors/parser.py | 2 +- src/tinycss/fonts3.py | 1 - 294 files changed, 248 insertions(+), 320 deletions(-) diff --git a/setup/browser_data.py b/setup/browser_data.py index ac86afcf40..6b17747857 100644 --- a/setup/browser_data.py +++ b/setup/browser_data.py @@ -9,7 +9,6 @@ import sys from datetime import datetime from urllib.request import urlopen -from polyglot.builtins import filter from setup import download_securely diff --git a/setup/translations.py b/setup/translations.py index 907f8edc38..269a2c24fd 100644 --- a/setup/translations.py +++ b/setup/translations.py @@ -13,7 +13,7 @@ from functools import partial from setup import Command, __appname__, __version__, require_git_master, build_cache_dir, edit_file, dump_json from setup.parallel_build import batched_parallel_jobs -from polyglot.builtins import codepoint_to_chr, iteritems, range +from polyglot.builtins import codepoint_to_chr, iteritems is_ci = os.environ.get('CI', '').lower() == 'true' diff --git a/src/calibre/__init__.py b/src/calibre/__init__.py index 09ea2b7e78..98b41ff80f 100644 --- a/src/calibre/__init__.py +++ b/src/calibre/__init__.py @@ -5,7 +5,7 @@ __copyright__ = '2008, Kovid Goyal ' __docformat__ = 'restructuredtext en' import sys, os, re, time, random, warnings -from polyglot.builtins import codepoint_to_chr, unicode_type, range, hasenv, native_string_type +from polyglot.builtins import codepoint_to_chr, unicode_type, hasenv, native_string_type from math import floor from functools import partial diff --git a/src/calibre/constants.py b/src/calibre/constants.py index 65eb5f51ec..2cf77a6787 100644 --- a/src/calibre/constants.py +++ b/src/calibre/constants.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # vim:fileencoding=utf-8 # License: GPLv3 Copyright: 2015, Kovid Goyal -from polyglot.builtins import map, unicode_type, environ_item, hasenv, getenv +from polyglot.builtins import unicode_type, environ_item, hasenv, getenv import sys, locale, codecs, os, collections, collections.abc __appname__ = 'calibre' diff --git a/src/calibre/customize/profiles.py b/src/calibre/customize/profiles.py index f7ac476391..8683d20e5b 100644 --- a/src/calibre/customize/profiles.py +++ b/src/calibre/customize/profiles.py @@ -5,7 +5,6 @@ __copyright__ = '2009, Kovid Goyal ' __docformat__ = 'restructuredtext en' from calibre.customize import Plugin as _Plugin -from polyglot.builtins import zip FONT_SIZES = [('xx-small', 1), ('x-small', None), diff --git a/src/calibre/customize/zipplugin.py b/src/calibre/customize/zipplugin.py index ec5aeaeaeb..45544b1900 100644 --- a/src/calibre/customize/zipplugin.py +++ b/src/calibre/customize/zipplugin.py @@ -22,7 +22,7 @@ from calibre import as_unicode from calibre.customize import ( InvalidPlugin, Plugin, PluginNotFound, numeric_version, platform ) -from polyglot.builtins import itervalues, map, reload, string_or_bytes, unicode_type +from polyglot.builtins import itervalues, reload, string_or_bytes, unicode_type # PEP 302 based plugin loading mechanism, works around the bug in zipimport in # python 2.x that prevents importing from zip files in locations whose paths diff --git a/src/calibre/db/__init__.py b/src/calibre/db/__init__.py index 73c707727c..31cc5f0e96 100644 --- a/src/calibre/db/__init__.py +++ b/src/calibre/db/__init__.py @@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en' SPOOL_SIZE = 30*1024*1024 import numbers -from polyglot.builtins import iteritems, range +from polyglot.builtins import iteritems def _get_next_series_num_for_list(series_indices, unwrap=True): diff --git a/src/calibre/db/adding.py b/src/calibre/db/adding.py index 11e955d265..ddd0878245 100644 --- a/src/calibre/db/adding.py +++ b/src/calibre/db/adding.py @@ -16,7 +16,7 @@ from calibre import prints from calibre.constants import filesystem_encoding, ismacos, iswindows from calibre.ebooks import BOOK_EXTENSIONS from calibre.utils.filenames import make_long_path_useable -from polyglot.builtins import itervalues, map as it_map, unicode_type +from polyglot.builtins import itervalues, unicode_type def splitext(path): @@ -71,7 +71,7 @@ def metadata_extensions(): # but not actually added) global _metadata_extensions if _metadata_extensions is None: - _metadata_extensions = frozenset(it_map(unicode_type, BOOK_EXTENSIONS)) | {'opf'} + _metadata_extensions = frozenset(map(unicode_type, BOOK_EXTENSIONS)) | {'opf'} return _metadata_extensions diff --git a/src/calibre/db/cache.py b/src/calibre/db/cache.py index 12a05047bc..5a3590df80 100644 --- a/src/calibre/db/cache.py +++ b/src/calibre/db/cache.py @@ -47,9 +47,7 @@ from calibre.utils.config import prefs, tweaks from calibre.utils.date import UNDEFINED_DATE, now as nowf, utcnow from calibre.utils.icu import sort_key from calibre.utils.localization import canonicalize_lang -from polyglot.builtins import ( - cmp, iteritems, itervalues, string_or_bytes, unicode_type, zip -) +from polyglot.builtins import cmp, iteritems, itervalues, string_or_bytes, unicode_type def api(f): diff --git a/src/calibre/db/categories.py b/src/calibre/db/categories.py index 6e57afef2a..6889900554 100644 --- a/src/calibre/db/categories.py +++ b/src/calibre/db/categories.py @@ -8,7 +8,7 @@ __docformat__ = 'restructuredtext en' import copy from functools import partial -from polyglot.builtins import iteritems, unicode_type, map, native_string_type +from polyglot.builtins import iteritems, unicode_type, native_string_type from calibre.ebooks.metadata import author_to_author_sort from calibre.utils.config_base import tweaks diff --git a/src/calibre/db/cli/cmd_list.py b/src/calibre/db/cli/cmd_list.py index bc1af37fd5..898b53f1d7 100644 --- a/src/calibre/db/cli/cmd_list.py +++ b/src/calibre/db/cli/cmd_list.py @@ -11,7 +11,7 @@ from textwrap import TextWrapper from calibre.db.cli.utils import str_width from calibre.ebooks.metadata import authors_to_string from calibre.utils.date import isoformat -from polyglot.builtins import as_bytes, iteritems, map, unicode_type +from polyglot.builtins import as_bytes, iteritems, unicode_type readonly = True version = 0 # change this if you change signature of implementation() diff --git a/src/calibre/db/cli/cmd_list_categories.py b/src/calibre/db/cli/cmd_list_categories.py index 83be465204..6344072316 100644 --- a/src/calibre/db/cli/cmd_list_categories.py +++ b/src/calibre/db/cli/cmd_list_categories.py @@ -8,7 +8,7 @@ import sys from textwrap import TextWrapper from calibre import prints -from polyglot.builtins import as_bytes, map, unicode_type +from polyglot.builtins import as_bytes, unicode_type readonly = True version = 0 # change this if you change signature of implementation() diff --git a/src/calibre/db/cli/utils.py b/src/calibre/db/cli/utils.py index 175cd7582f..e15609dcea 100644 --- a/src/calibre/db/cli/utils.py +++ b/src/calibre/db/cli/utils.py @@ -3,8 +3,6 @@ # License: GPLv3 Copyright: 2017, Kovid Goyal -from polyglot.builtins import map - import unicodedata eaw = unicodedata.east_asian_width diff --git a/src/calibre/db/legacy.py b/src/calibre/db/legacy.py index 709e2168bc..414e0d3209 100644 --- a/src/calibre/db/legacy.py +++ b/src/calibre/db/legacy.py @@ -6,7 +6,7 @@ __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal ' import os, traceback, weakref -from polyglot.builtins import iteritems, zip +from polyglot.builtins import iteritems from collections.abc import MutableMapping from calibre import force_unicode, isbytestring diff --git a/src/calibre/db/restore.py b/src/calibre/db/restore.py index c9b293b608..77ada98152 100644 --- a/src/calibre/db/restore.py +++ b/src/calibre/db/restore.py @@ -17,7 +17,7 @@ from calibre.db.cache import Cache from calibre.constants import filesystem_encoding from calibre.utils.date import utcfromtimestamp from calibre import isbytestring, force_unicode -from polyglot.builtins import iteritems, filter +from polyglot.builtins import iteritems NON_EBOOK_EXTENSIONS = frozenset(( 'jpg', 'jpeg', 'gif', 'png', 'bmp', diff --git a/src/calibre/db/tables.py b/src/calibre/db/tables.py index 89295bdbd3..028d8341fd 100644 --- a/src/calibre/db/tables.py +++ b/src/calibre/db/tables.py @@ -12,7 +12,7 @@ from collections import defaultdict from calibre.utils.date import parse_date, UNDEFINED_DATE, utc_tz from calibre.ebooks.metadata import author_to_author_sort -from polyglot.builtins import iteritems, itervalues, range +from polyglot.builtins import iteritems, itervalues from calibre_extensions.speedup import parse_date as _c_speedup diff --git a/src/calibre/db/tests/base.py b/src/calibre/db/tests/base.py index 9c3c36713b..12a7ae691e 100644 --- a/src/calibre/db/tests/base.py +++ b/src/calibre/db/tests/base.py @@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en' import unittest, os, shutil, tempfile, atexit, gc, time from functools import partial from io import BytesIO -from polyglot.builtins import map, unicode_type +from polyglot.builtins import unicode_type rmtree = partial(shutil.rmtree, ignore_errors=True) diff --git a/src/calibre/db/tests/legacy.py b/src/calibre/db/tests/legacy.py index 01846511df..743928ec79 100644 --- a/src/calibre/db/tests/legacy.py +++ b/src/calibre/db/tests/legacy.py @@ -12,7 +12,7 @@ from operator import itemgetter from calibre.library.field_metadata import fm_as_dict from calibre.db.tests.base import BaseTest -from polyglot.builtins import iteritems, range, unicode_type, zip +from polyglot.builtins import iteritems, unicode_type from polyglot import reprlib # Utils {{{ diff --git a/src/calibre/db/tests/locking.py b/src/calibre/db/tests/locking.py index 6c2ace6551..633ebddff0 100644 --- a/src/calibre/db/tests/locking.py +++ b/src/calibre/db/tests/locking.py @@ -9,7 +9,6 @@ import time, random from threading import Thread from calibre.db.tests.base import BaseTest from calibre.db.locking import SHLock, RWLockWrapper, LockingError -from polyglot.builtins import range def wait_for(period): diff --git a/src/calibre/db/tests/reading.py b/src/calibre/db/tests/reading.py index e807b5b719..2af44ae003 100644 --- a/src/calibre/db/tests/reading.py +++ b/src/calibre/db/tests/reading.py @@ -13,7 +13,7 @@ from time import time from calibre.utils.date import utc_tz from calibre.utils.localization import calibre_langcode_to_name from calibre.db.tests.base import BaseTest -from polyglot.builtins import iteritems, itervalues, range +from polyglot.builtins import iteritems, itervalues def p(x): diff --git a/src/calibre/db/utils.py b/src/calibre/db/utils.py index a9816a2142..d3c988665f 100644 --- a/src/calibre/db/utils.py +++ b/src/calibre/db/utils.py @@ -8,7 +8,7 @@ __copyright__ = '2013, Kovid Goyal ' import os, errno, sys, re from locale import localeconv from collections import OrderedDict, namedtuple -from polyglot.builtins import iteritems, itervalues, map, unicode_type, string_or_bytes, filter +from polyglot.builtins import iteritems, itervalues, unicode_type, string_or_bytes from threading import Lock from calibre import as_unicode, prints diff --git a/src/calibre/db/view.py b/src/calibre/db/view.py index be8fa4601e..e9af22ccc3 100644 --- a/src/calibre/db/view.py +++ b/src/calibre/db/view.py @@ -8,8 +8,7 @@ __docformat__ = 'restructuredtext en' import weakref, operator, numbers from functools import partial -from polyglot.builtins import (iteritems, itervalues, map, - unicode_type, range) +from polyglot.builtins import iteritems, itervalues, unicode_type from calibre.ebooks.metadata import title_sort from calibre.utils.config_base import tweaks, prefs diff --git a/src/calibre/db/write.py b/src/calibre/db/write.py index ed00376cb0..d3beb31794 100644 --- a/src/calibre/db/write.py +++ b/src/calibre/db/write.py @@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en' import re from functools import partial from datetime import datetime -from polyglot.builtins import iteritems, itervalues, unicode_type, zip +from polyglot.builtins import iteritems, itervalues, unicode_type from calibre.constants import preferred_encoding from calibre.ebooks.metadata import author_to_author_sort, title_sort diff --git a/src/calibre/devices/__init__.py b/src/calibre/devices/__init__.py index 290b8dc6d2..df5405255b 100644 --- a/src/calibre/devices/__init__.py +++ b/src/calibre/devices/__init__.py @@ -8,7 +8,7 @@ Device drivers. import sys, time, pprint from functools import partial -from polyglot.builtins import zip, unicode_type +from polyglot.builtins import unicode_type DAY_MAP = dict(Sun=0, Mon=1, Tue=2, Wed=3, Thu=4, Fri=5, Sat=6) MONTH_MAP = dict(Jan=1, Feb=2, Mar=3, Apr=4, May=5, Jun=6, Jul=7, Aug=8, Sep=9, Oct=10, Nov=11, Dec=12) diff --git a/src/calibre/devices/cybook/t4b.py b/src/calibre/devices/cybook/t4b.py index dca767e9df..33a327ea2d 100644 --- a/src/calibre/devices/cybook/t4b.py +++ b/src/calibre/devices/cybook/t4b.py @@ -7,7 +7,6 @@ Write a t4b file to disk. ''' from io import BytesIO -from polyglot.builtins import range DEFAULT_T4B_DATA = b'\x74\x34\x62\x70\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc4\x00\x16\xdf\xff\xff\xf7\x6d\xff\xff\xfd\x7a\xff\xff\xff\xe7\x77\x76\xff\xf6\x77\x77\x8d\xff\xff\xe7\x77\x78\xbf\xff\xff\xf7\x77\x77\x77\x7d\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xe4\x03\x78\x61\x07\xff\xff\x90\x04\xff\xff\xfc\x05\xff\xff\xff\xd5\x30\x35\xff\xf0\x13\x32\x00\x5f\xff\xd0\x03\x32\x01\xbf\xff\xe0\x00\x00\x00\x0b\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x50\x8f\xff\xff\x75\xff\xff\x40\x30\xef\xff\xfc\x06\xff\xff\xff\xff\xa0\x9f\xff\xf0\x6f\xff\xf5\x0d\xff\xd0\x4f\xff\xd0\x0f\xff\xe0\x3f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfd\x05\xff\xff\xff\xfe\xff\xfe\x03\xa0\x8f\xff\xfc\x06\xff\xff\xff\xff\xa0\x9f\xff\xf0\x6f\xff\xfb\x0b\xff\xd0\x4f\xff\xf7\x0d\xff\xe0\x3f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf6\x0e\xff\xff\xff\xff\xff\xfa\x0b\xe0\x3f\xff\xfc\x06\xff\xff\xff\xff\xa0\x9f\xff\xf0\x6f\xff\xf5\x0e\xff\xd0\x4f\xff\xf8\x0e\xff\xe0\x3f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf1\x1f\xff\xff\xff\xff\xff\xf2\x0f\xf3\x0d\xff\xfc\x06\xff\xff\xff\xff\xa0\x9f\xff\xf0\x39\x88\x30\xaf\xff\xd0\x4f\xff\xf2\x1f\xff\xe0\x18\x88\x88\x8d\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\x3f\xff\xff\xff\xff\xff\xd0\x6f\xfc\x09\xff\xfc\x06\xff\xff\xff\xff\xa0\x9f\xff\xf0\x01\x11\x00\x2c\xff\xd0\x3a\xa8\x20\xcf\xff\xe0\x00\x00\x00\x0b\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\x2f\xff\xff\xff\xff\xff\x60\xaf\xff\x11\xff\xfc\x06\xff\xff\xff\xff\xa0\x9f\xff\xf0\x6f\xff\xfd\x10\xef\xd0\x00\x00\x1e\xff\xff\xe0\x3f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf2\x0f\xff\xff\xff\xff\xfe\x20\x12\x22\x00\xcf\xfc\x06\xff\xff\xff\xff\xa0\x9f\xff\xf0\x6f\xff\xff\x90\x9f\xd0\x3d\xd8\x09\xff\xff\xe0\x3f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf8\x0b\xff\xff\xff\xff\xfc\x03\x88\x88\x60\x4f\xfc\x06\xff\xff\xff\xff\xa0\x9f\xff\xf0\x6f\xff\xff\xa0\x8f\xd0\x4f\xff\x40\xcf\xff\xe0\x3f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\xef\xff\xff\xfb\xf7\x0d\xff\xff\xf1\x1e\xfc\x06\xff\xff\xff\xff\xa0\x9f\xff\xf0\x6f\xff\xff\x60\xcf\xd0\x4f\xff\xf3\x0d\xff\xe0\x3f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x80\x2c\xff\xfa\x05\xf0\x2f\xff\xff\xf6\x0b\xfc\x03\x88\x88\x88\xff\xb0\xaf\xff\xf0\x5d\xcc\xa3\x05\xff\xd0\x4f\xff\xfe\x11\xef\xe0\x18\x88\x88\x8d\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf8\x10\x01\x00\x3b\xb0\x9f\xff\xff\xfd\x06\xfc\x00\x00\x00\x00\xd0\x00\x00\xff\xf0\x00\x00\x02\x7f\xff\xe1\x5f\xff\xff\xc0\x5f\xe1\x00\x00\x00\x0b\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xed\xa9\xbd\xff\xed\xff\xff\xff\xff\xde\xff\xdd\xdd\xdd\xdd\xfd\xdd\xdd\xff\xfd\xdd\xdd\xee\xff\xff\xfd\xef\xff\xff\xfe\xdf\xfd\xdd\xdd\xdd\xdf\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xed\xdb\x86\x8e\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xb7\x42\x00\x00\x0b\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfd\x00\x00\x00\x00\x09\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfd\x00\x00\x01\x11\x17\xef\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xee\xee\xee\xee\xee\xee\xee\xee\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\x22\x45\x78\x9b\x95\xef\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xb8\x77\x78\x88\x88\x88\x87\x87\x89\xdf\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\x57\x9a\xaa\xaa\x94\xdf\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\x00\x00\x11\x11\x22\x12\x11\x11\x10\x7e\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x76\xaa\xaa\xab\xa4\xcf\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x12\x23\x33\x33\x33\x33\x32\x21\x6e\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xa5\xaa\xa9\x99\xa5\xaf\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x33\x44\x44\x44\x33\x21\x6d\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xb4\xaa\xa9\xa9\xb6\x8f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x23\x34\x44\x54\x55\x44\x44\x31\x6d\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc5\x9a\x99\x9a\xb8\x7e\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x23\x34\x44\x44\x55\x45\x44\x31\x6d\xff\xff\xff\xff\xff\xff\xff\xff\xee\xdd\xdd\xee\xee\xc5\x9a\x88\x8a\xa9\x6e\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x44\x44\x44\x44\x44\x31\x6d\xff\xff\xff\xff\xff\xff\xff\xfe\xdc\xbb\xab\xcc\xca\x84\x8a\xa9\x99\xaa\x5d\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x44\x44\x44\x44\x44\x31\x6d\xff\xff\xff\xff\xff\xff\xff\xed\xa9\x99\x78\x87\x78\x84\x7a\xaa\x89\x9a\x6c\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x23\x34\x44\x45\x55\x55\x44\x31\x6d\xff\xff\xff\xff\xff\xff\xff\xec\x98\x88\x76\x98\x88\x74\x7a\xaa\xa7\x9a\x6b\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x23\x33\x34\x44\x54\x44\x44\x31\x6d\xff\xff\xff\xff\xff\xff\xff\xdb\x98\x88\x76\x98\x88\x74\x5a\xaa\x89\x9b\x7a\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x44\x45\x55\x54\x43\x31\x6d\xff\xff\xff\xff\xff\xff\xfe\xdb\x98\x88\x76\x98\x88\x84\x4a\xaa\x97\xbb\x79\xef\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x34\x44\x44\x44\x44\x31\x5b\xcc\xcc\xcc\xcc\xcc\xcc\xcb\xba\x98\x88\x76\x88\x88\x85\x39\xa9\x8a\xab\x97\xef\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x33\x34\x44\x44\x43\x31\x34\x44\x44\x55\x55\x55\x55\x44\x46\x98\x88\x76\x78\x88\x85\x28\xa8\x9a\xab\xa5\xef\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf9\x00\x11\x11\x11\x12\x22\x22\x11\x10\x00\x01\x22\x23\x33\x33\x33\x31\x11\x88\x88\x76\x68\x88\x85\x27\xa9\xa9\xab\xa5\xdf\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x12\x23\x33\x33\x44\x43\x33\x21\x00\x12\x33\x44\x55\x55\x65\x42\x11\x78\x88\x76\x68\x88\x85\x36\xaa\xaa\xab\xb5\xcf\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x34\x44\x54\x44\x44\x21\x01\x23\x44\x55\x66\x66\x66\x53\x21\x78\x88\x86\x68\x88\x85\x45\xaa\xaa\xbb\xb6\xaf\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x34\x44\x44\x44\x33\x21\x01\x23\x45\x56\x67\x77\x77\x54\x21\x78\x88\x86\x68\x88\x85\x54\xaa\xab\xbb\xb7\x8f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x44\x44\x44\x44\x43\x21\x01\x23\x57\x8a\xaa\xaa\x99\x74\x21\x79\x88\x86\x68\x88\x75\x44\x9a\xab\xbb\xb9\x6e\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x34\x44\x44\x55\x43\x21\x01\x24\x56\x78\x89\x99\x88\x74\x21\x69\x88\x87\x68\x88\x75\x53\x9a\xab\xbb\xba\x5e\xff\xff\xff\xff\xff\xed\xa7\x9e\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x44\x34\x44\x54\x44\x21\x01\x23\x45\x56\x67\x77\x77\x64\x21\x69\x88\x87\x68\x88\x65\x53\x8a\xaa\xaa\xba\x5d\xff\xff\xff\xed\xb9\x75\x54\x5b\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x84\x66\x48\x54\x43\x21\x01\x23\x45\x56\x67\x77\x76\x64\x21\x6a\x88\x87\x68\x88\x66\x54\x7a\xaa\x9a\xbb\x6b\xff\xee\xb9\x66\x66\x78\x75\x69\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x64\x54\x47\x54\x43\x21\x01\x23\x45\x66\x77\x67\x67\x64\x21\x6a\x88\x87\x68\x88\x76\x54\x6a\xbb\xba\xbb\x79\xca\x75\x56\x77\x88\x88\x85\x68\xef\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x23\x33\xba\xba\xac\x44\x43\x21\x01\x23\x45\x56\x66\x66\x76\x64\x21\x6a\x88\x87\x67\x88\x66\x54\x5a\xbb\xa9\xbb\x83\x45\x67\x78\x64\x78\x88\x86\x66\xdf\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x87\x77\x79\x54\x43\x21\x01\x23\x45\x56\x66\x67\x77\x54\x21\x6a\x88\x87\x67\x88\x66\x54\x4a\xbb\xab\xbb\x93\x47\x88\x88\x66\x38\x88\x98\x66\xbf\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x44\x44\x44\x54\x44\x21\x01\x23\x45\x56\x66\x67\x77\x64\x21\x6a\x88\x88\x66\x98\x66\x55\x3a\xab\xba\xab\xa4\x47\x88\x87\x68\x43\x89\x99\x57\x8f\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x32\x34\x3a\x44\x43\x21\x01\x23\x45\x56\x66\x67\x66\x64\x31\x69\x88\x88\x65\x98\x66\x55\x39\xbb\xba\xbc\xa4\x47\x88\x87\x77\x85\x37\xaa\x78\x7e\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\xad\x76\xc5\x44\x33\x21\x01\x23\x44\x56\x66\x77\x76\x54\x21\x69\x98\x88\x65\x98\x66\x65\x38\xbb\xb9\xbb\xb5\x46\x77\x86\x68\x87\x78\x9a\x87\x7c\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x84\x7b\x44\x44\x33\x21\x01\x23\x44\x56\x67\x76\x76\x63\x21\x79\x98\x88\x76\x87\x66\x65\x46\xaa\x99\xab\xb5\x45\x88\x76\x67\x77\x78\x9a\x96\x8a\xff\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x63\x54\x46\x54\x43\x21\x01\x23\x44\x55\x66\x67\x76\x64\x21\x79\x98\x88\x76\x77\x66\x65\x44\xab\xbb\xaa\xb7\x35\x88\x87\x77\x89\x99\x9a\x96\x89\xef\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\xbb\xba\xbc\x44\x43\x21\x01\x23\x44\x56\x67\x66\x76\x63\x21\x79\x98\x88\x76\x68\x66\x65\x53\xab\xba\xaa\xb8\x35\x78\x88\x89\x99\x99\x9a\xa7\x88\xef\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x54\x44\x45\x44\x34\x21\x01\x23\x44\x56\x66\x86\x66\x54\x21\x79\x98\x88\x76\x68\x66\x65\x63\x9a\xba\xab\xb9\x35\x68\x88\x99\x99\x9a\x9a\xa8\x77\xcf\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x33\x43\x43\x44\x43\x21\x01\x23\x44\x55\x66\x76\x66\x54\x21\x7a\x98\x88\x76\x68\x66\x65\x63\x8a\xab\xa9\xba\x35\x58\x88\x99\x99\x99\x9a\xa9\x67\xaf\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x12\x23\x69\x2a\xd9\x34\x33\x21\x01\x23\x44\x55\x67\x67\x66\x53\x21\x7a\x98\x88\x76\x67\x66\x66\x54\x7a\xa9\x9a\xbb\x44\x48\x99\x99\x89\x99\xaa\xaa\x68\x8e\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x97\x98\x47\x44\x34\x21\x01\x23\x44\x56\x66\x76\x66\x53\x21\x7a\x98\x88\x76\x67\x66\x66\x55\x6a\xbb\x9a\xbb\x54\x57\x99\x98\x79\x9a\xaa\xaa\x87\x7d\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x53\x44\x36\x54\x44\x21\x00\x23\x44\x55\x66\x66\x66\x53\x21\x7a\x98\x87\x76\x67\x66\x66\x55\x5a\xaa\xaa\xbb\x73\x66\x99\x66\x59\x77\xaa\xaa\x97\x8b\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\xcc\xcc\xcd\x44\x33\x21\x01\x23\x34\x55\x66\x66\x66\x53\x21\x7b\x98\x88\x76\x66\x66\x66\x65\x4a\xaa\xab\xab\x83\x66\x88\x55\x48\x84\x5a\xaa\xa6\x89\xff\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x44\x34\x45\x44\x33\x21\x01\x23\x44\x55\x56\x66\x66\x53\x21\x7b\x98\x88\x76\x66\x66\x66\x56\x49\x9a\xaa\x9b\x94\x55\x88\x66\x78\x86\x98\xaa\xa7\x88\xef\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x33\x33\x44\x44\x33\x21\x00\x22\x34\x55\x66\x66\x66\x53\x21\x8b\xa7\x88\x86\x66\x66\x66\x56\x38\xa7\x99\xaa\x95\x56\x79\x99\x97\x76\x96\xaa\xa8\x88\xdf\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x33\x76\x77\x78\x44\x33\x21\x01\x22\x34\x45\x54\x66\x66\x53\x21\x8b\xa7\x78\x86\x56\x66\x66\x55\x48\xaa\xaa\xaa\xa5\x56\x69\x99\x99\x85\x79\x7a\xa9\x68\xbf\xff\xff\xff\xff\xff\xff\xfa\x11\x12\x33\xaa\xaa\xab\x34\x33\x21\x00\x23\x34\x45\x6b\x66\x66\x53\x21\x8b\xa8\x78\x76\x56\x76\x66\x65\x47\xaa\xa9\x9a\xa6\x66\x59\x99\x99\xa6\x6a\x6a\xaa\x68\x9f\xff\xff\xff\xff\xff\xff\xfa\x11\x12\x23\x43\x33\x33\x34\x33\x21\x00\x22\x34\x45\x68\x86\x66\x53\x21\x8c\xa8\x77\x76\x56\x76\x66\x66\x45\xaa\xa9\xab\xb6\x85\x58\x99\x99\x99\x6a\x69\xaa\x67\x7e\xff\xff\xff\xff\xff\xff\xfa\x11\x12\x23\x33\x34\x49\x75\x33\x21\x00\x22\x34\x45\x66\x66\x65\x53\x21\x8c\xa8\x77\x66\x55\x76\x66\x66\x54\xa9\x99\x9b\xa7\x76\x66\x99\x99\xa6\x69\x88\xaa\x87\x6c\xff\xff\xff\xff\xff\xff\xfa\x11\x12\x23\x33\x33\x37\x34\x33\x21\x00\x12\x34\x45\x59\x86\x66\x53\x21\x8c\xb9\x77\x66\x55\x76\x66\x65\x63\x9a\xaa\xba\xb8\x67\x66\x99\x99\x97\x68\x96\xaa\xa6\x7a\xff\xff\xff\xff\xff\xff\xfa\x11\x22\x23\x54\x44\x46\x44\x43\x21\x00\x22\x34\x58\x59\xa5\x65\x53\x21\x8c\xb9\x77\x76\x56\x76\x66\x65\x63\x8a\xaa\xaa\xb9\x58\x65\x89\x99\x99\x86\xa3\xaa\xa6\x88\xef\xff\xff\xff\xff\xff\xfa\x11\x12\x23\xab\xbb\xbc\x33\x33\x21\x00\x12\x34\x46\x66\x66\x55\x43\x21\x8c\xb9\x77\x76\x56\x76\x66\x65\x64\x7a\xaa\x9a\xba\x49\x66\x89\x99\x99\x95\xa4\x5a\xa7\x87\xdf\xff\xff\xff\xff\xff\xfa\x11\x12\x22\x42\x33\x35\x44\x33\x21\x00\x12\x34\x48\x86\x85\x55\x43\x21\x8c\xb9\x67\x77\x56\x67\x66\x66\x65\x6a\xaa\x9a\xba\x4a\x67\x79\x99\x86\x76\x86\x27\xa8\x67\xcf\xff\xff\xff\xff\xff\xfa\x11\x12\x23\x33\x33\x35\x33\x33\x21\x00\x12\x33\x54\x88\x56\x65\x43\x21\x8d\xba\x66\x77\x56\x57\x66\x66\x65\x5a\xab\xaa\xbb\x59\x76\x59\x99\x99\x97\x98\x24\xa9\x67\xaf\xff\xff\xff\xff\xff\xfa\x11\x12\x22\x21\x36\x9b\x33\x33\x21\x00\x12\x34\x45\x56\x76\x55\x43\x21\x8d\xca\x76\x77\x66\x57\x66\x65\x65\x5a\xaa\x9a\xbb\x78\x96\x58\x99\x99\x88\x9a\x44\xa9\x67\x8e\xff\xff\xff\xff\xff\xfa\x11\x12\x23\x6a\xb7\x44\x43\x33\x21\x00\x12\x34\x44\x55\x85\x55\x43\x21\x8d\xca\x77\x67\x66\x67\x66\x66\x66\x49\xaa\xaa\xab\x87\xc5\x57\x98\x98\x87\x68\x85\x99\x76\x6d\xff\xff\xff\xff\xff\xfa\x11\x12\x23\x96\x33\x43\x33\x33\x21\x00\x12\x33\x44\x65\x55\x55\x43\x21\x8d\xca\x87\x76\x66\x67\x66\x66\x56\x59\xa9\x99\xab\x96\xc6\x65\x98\x89\x99\x68\x98\x99\x86\x6b\xff\xff\xff\xff\xff\xfa\x11\x12\x22\x44\x75\x23\x33\x33\x21\x00\x12\x33\x44\x6a\x65\x55\x43\x21\x8d\xca\x87\x76\x66\x67\x66\x66\x66\x58\xa8\x9a\x9b\xa5\xc9\x65\x88\x89\x99\x77\x98\x99\x95\x68\xff\xff\xff\xff\xff\xfa\x11\x12\x22\x22\x24\x79\x33\x33\x21\x00\x12\x34\x44\x56\x75\x55\x43\x21\x8d\xda\x87\x77\x66\x67\x66\x66\x66\x47\xa9\x9a\xbb\xa6\xcb\x65\x78\x88\x88\x85\x68\x99\x96\x66\xef\xff\xff\xff\xff\xfa\x11\x12\x23\x11\x33\x34\x33\x32\x21\x00\x12\x33\x44\x57\x65\x55\x43\x21\x8d\xda\x87\x77\x65\x76\x76\x66\x67\x56\xaa\xbb\xaa\xa6\xbc\x66\x68\x88\x88\x85\x88\x89\x97\x66\xcf\xff\xff\xff\xff\xfa\x11\x12\x23\x95\x23\x36\x33\x33\x21\x00\x12\x33\x44\x58\x65\x55\x43\x21\x8d\xda\x96\x77\x65\x77\x66\x66\x57\x55\xaa\xaa\xaa\xb6\xad\x66\x58\x88\x88\x85\x78\x88\x98\x66\xaf\xff\xff\xff\xff\xfa\x11\x12\x22\x52\x33\x35\x33\x33\x21\x00\x12\x33\x44\x55\x65\x55\x42\x21\x8e\xdb\x97\x67\x75\x77\x66\x66\x56\x64\xaa\xbb\xaa\xa7\x8e\x85\x58\x87\x88\x87\x88\x88\x88\x56\x8f\xff\xff\xff\xff\xfa\x11\x12\x22\x42\x23\x35\x43\x32\x21\x00\x12\x33\x44\x48\x85\x55\x43\x21\x8e\xdb\x97\x67\x75\x77\x66\x66\x66\x73\x9b\xaa\xaa\xb8\x6e\xb4\x57\x87\x87\x77\x78\x88\x88\x56\x7e\xff\xff\xff\xff\xfa\x11\x12\x22\x42\x33\x28\x33\x32\x21\x00\x12\x33\x44\x55\x55\x55\x43\x21\x8e\xdb\x97\x76\x76\x67\x76\x66\x66\x74\x8a\xba\xaa\xb9\x5d\xd5\x55\x77\x77\x77\x47\x88\x88\x65\x5d\xff\xff\xff\xff\xfa\x10\x12\x22\x63\x11\x78\x33\x32\x20\x00\x12\x33\x34\x47\x84\x55\x42\x21\x8e\xec\x97\x77\x66\x67\x87\x76\x66\x74\x7a\xaa\xaa\xba\x4d\xe7\x54\x77\x77\x77\x56\x87\x88\x74\x5a\xff\xff\xff\xff\xfa\x11\x12\x22\x28\x9a\x83\x33\x32\x20\x00\x12\x33\x44\x55\x55\x55\x42\x21\x9e\xec\x97\x77\x66\x67\x76\x66\x66\x76\x6a\xaa\x99\xba\x4b\xfa\x54\x67\x77\x77\x65\x77\x77\x84\x57\xef\xff\xff\xff\xfa\x11\x12\x22\x22\x33\x33\x33\x22\x10\x00\x12\x33\x33\x56\x45\x54\x42\x11\x9e\xec\x97\x77\x75\x67\x76\x66\x65\x67\x5a\xaa\x99\xba\x59\xfc\x54\x57\x77\x76\x65\x77\x77\x75\x55\xdf\xff\xff\xff\xfa\x11\x12\x22\x22\x33\x33\x33\x22\x20\x00\x12\x33\x35\x45\x65\x54\x42\x21\x9e\xec\xa7\x77\x76\x67\x86\x66\x65\x68\x4a\xa9\x8a\xbb\x77\xfd\x65\x56\x76\x76\x64\x67\x77\x76\x55\xbf\xff\xff\xff\xfa\x11\x12\x22\x22\x32\x33\x23\x22\x20\x00\x12\x23\x45\x55\x54\x44\x42\x11\x9e\xec\xa7\x67\x76\x68\x77\x66\x66\x68\x4a\xb9\x88\xaa\x96\xef\x75\x46\x66\x66\x65\x45\x77\x77\x45\x9f\xff\xff\xff\xfa\x10\x12\x22\x22\x22\x33\x32\x22\x20\x00\x12\x23\x33\x44\x54\x54\x42\x21\x8e\xed\xa8\x76\x76\x58\x77\x66\x66\x67\x59\xba\xa8\xa9\xa5\xef\x94\x46\x66\x66\x66\x46\x67\x77\x45\x7e\xff\xff\xff\xfa\x11\x12\x22\x22\x33\x33\x23\x32\x21\x00\x12\x23\x34\x54\x44\x44\x42\x11\x8e\xfd\xb8\x76\x67\x67\x68\x77\x66\x67\x68\xaa\xa9\x7b\xa5\xcf\xc3\x45\x66\x66\x66\x67\x66\x67\x55\x5d\xff\xff\xff\xf9\x00\x00\x11\x11\x11\x11\x11\x11\x10\x00\x12\x23\x34\x34\x44\x44\x42\x11\x8e\xfd\xb8\x77\x66\x67\x77\x66\x66\x67\x77\xaa\xa8\xa9\xb6\xbf\xe5\x44\x66\x66\x66\x66\x66\x67\x54\x4b\xff\xff\xff\xf9\x00\x01\x11\x11\x11\x11\x11\x11\x10\x00\x12\x23\x33\x44\x44\x44\x32\x11\x8e\xfd\xb8\x77\x76\x67\x77\x66\x66\x57\x76\xba\xa8\x7a\xb6\xaf\xf8\x43\x66\x66\x66\x66\x66\x66\x63\x48\xff\xff\xff\xfa\x10\x11\x22\x22\x22\x22\x32\x22\x10\x00\x12\x23\x34\x44\x44\x44\x32\x11\x8e\xfd\xb9\x77\x76\x57\x87\x66\x66\x66\x85\xbb\xa8\x8b\xa7\x9f\xfb\x43\x56\x66\x66\x66\x66\x66\x64\x45\xef\xff\xff\xfa\x10\x12\x22\x22\x22\x32\x22\x22\x10\x00\x12\x23\x33\x44\x44\x44\x32\x11\x8e\xfe\xb9\x67\x77\x57\x87\x76\x66\x66\x84\xab\x89\xaa\xb8\x8e\xfd\x54\x46\x66\x55\x55\x55\x66\x65\x43\xdf\xff\xff\xfa\x10\x12\x22\x22\x22\x32\x22\x22\x20\x00\x12\x23\x33\x44\x44\x44\x32\x11\x8e\xfe\xca\x66\x77\x57\x87\x77\x66\x67\x84\xab\x9a\xa9\xb9\x6e\xfe\x64\x35\x66\x55\x66\x65\x56\x66\x34\x9f\xff\xff\xfa\x10\x11\x12\x22\x22\x33\x22\x22\x10\x00\x11\x23\x34\x44\x55\x44\x32\x11\x8e\xfe\xca\x76\x77\x66\x87\x76\x66\x57\x84\x9b\x9a\x9a\xaa\x5d\xff\x84\x35\x66\x56\x66\x55\x45\x66\x44\x7f\xff\xff\xfa\x00\x11\x22\x22\x22\x22\x32\x22\x10\x00\x12\x34\x67\x78\x88\x76\x53\x11\x8e\xfe\xca\x76\x67\x66\x88\x66\x66\x56\x85\x7b\xaa\xba\xaa\x4c\xff\xb4\x45\x66\x55\x55\x45\x45\x66\x44\x5d\xff\xff\xfa\x10\x11\x22\x22\x33\x33\x23\x32\x10\x00\x12\x23\x34\x44\x44\x44\x42\x11\x8e\xfe\xca\x77\x66\x66\x88\x66\x66\x66\x87\x6b\xba\xab\xbb\x4b\xff\xd4\x44\x65\x54\x44\x44\x45\x55\x43\x4c\xff\xff\xfa\x00\x11\x22\x22\x22\x22\x22\x22\x10\x00\x11\x22\x33\x34\x44\x44\x32\x11\x8d\xed\xb9\x87\x76\x66\x78\x76\x66\x66\x78\x4b\xba\x98\x65\x18\xff\xe6\x33\x55\x54\x44\x55\x55\x54\x42\x5d\xff\xff\xea\x00\x11\x11\x22\x22\x22\x22\x21\x10\x00\x11\x12\x22\x22\x33\x32\x21\x10\x6a\xba\x98\x87\x77\x66\x66\x77\x76\x66\x77\x23\x11\x11\x11\x05\xcd\xd8\x33\x55\x55\x55\x54\x44\x34\x7b\xdf\xee\xee\xd8\x00\x01\x11\x11\x11\x11\x11\x11\x00\x00\x00\x11\x11\x12\x22\x12\x11\x00\x59\x99\x87\x87\x77\x66\x66\x76\x76\x66\x77\x10\x11\x11\x11\x02\xaa\xa9\x33\x45\x55\x44\x44\x58\xbd\xee\xff\xdd\xcc\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x11\x11\x11\x10\x00\x69\x99\x87\x97\x77\x76\x76\x76\x65\x55\x67\x20\x10\x00\x00\x05\x99\x98\x43\x24\x33\x46\x89\xbc\xcd\xde\xee\xdc\xcc\xba\x42\x22\x22\x22\x22\x22\x22\x22\x22\x42\x11\x22\x22\x22\x22\x22\x21\x24\x79\x99\x88\x97\x66\x77\x77\x86\x67\x77\x88\x50\x00\x23\x46\x88\x99\x99\x63\x25\x78\x9a\xab\xbc\xcd\xde\xee\xee\xed\xdc\xbb\xaa\xa9\x99\x99\x99\x88\x88\x88\x88\x77\x77\x77\x77\x77\x77\x77\x78\x99\x99\x98\x88\x88\x88\x88\x88\x88\x88\x99\x87\x78\x99\x99\xaa\xaa\xaa\xa9\xaa\xbb\xcc\xcd\xdd\xee\xef\xff\xff\xff\xff\xee\xee\xed\xdd\xdd\xdc\xcc\xcc\xcc\xbb\xbb\xbb\xbb\xbb\xbb\xba\xaa\xaa\xab\xba\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xbb\xbb\xbb\xbb\xcc\xcc\xcc\xcd\xdd\xdd\xde\xee\xee\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xee\xee\xee\xee\xee\xee\xee\xee\xee\xee\xee\xed\xdd\xdd\xdd\xee\xee\xee\xee\xee\xee\xee\xee\xee\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' # noqa diff --git a/src/calibre/devices/jetbook/driver.py b/src/calibre/devices/jetbook/driver.py index 2683570808..0d476a9524 100644 --- a/src/calibre/devices/jetbook/driver.py +++ b/src/calibre/devices/jetbook/driver.py @@ -15,7 +15,7 @@ import re from calibre.constants import filesystem_encoding from calibre.devices.usbms.driver import USBMS from calibre.ebooks.metadata import string_to_authors -from polyglot.builtins import unicode_type, map +from polyglot.builtins import unicode_type class JETBOOK(USBMS): diff --git a/src/calibre/devices/kindle/apnx.py b/src/calibre/devices/kindle/apnx.py index d93d32327c..7fdeea5951 100644 --- a/src/calibre/devices/kindle/apnx.py +++ b/src/calibre/devices/kindle/apnx.py @@ -18,7 +18,7 @@ from calibre.ebooks.mobi.reader.headers import MetadataHeader from calibre.utils.logging import default_log from calibre import prints, fsync from calibre.constants import DEBUG -from polyglot.builtins import range, as_unicode, as_bytes, unicode_type, map +from polyglot.builtins import as_unicode, as_bytes, unicode_type class APNXBuilder: diff --git a/src/calibre/devices/mtp/driver.py b/src/calibre/devices/mtp/driver.py index a47cfff3ff..1f709ce445 100644 --- a/src/calibre/devices/mtp/driver.py +++ b/src/calibre/devices/mtp/driver.py @@ -16,7 +16,7 @@ from calibre.devices.mtp.base import debug from calibre.devices.mtp.defaults import DeviceDefaults from calibre.ptempfile import SpooledTemporaryFile, PersistentTemporaryDirectory from calibre.utils.filenames import shorten_components_to -from polyglot.builtins import iteritems, itervalues, unicode_type, zip, as_bytes +from polyglot.builtins import iteritems, itervalues, unicode_type, as_bytes BASE = importlib.import_module('calibre.devices.mtp.%s.driver'%( 'windows' if iswindows else 'unix')).MTP_DEVICE diff --git a/src/calibre/devices/mtp/filesystem_cache.py b/src/calibre/devices/mtp/filesystem_cache.py index 3ddf5a22f1..f5c5a4539d 100644 --- a/src/calibre/devices/mtp/filesystem_cache.py +++ b/src/calibre/devices/mtp/filesystem_cache.py @@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en' import weakref, sys, json from collections import deque from operator import attrgetter -from polyglot.builtins import itervalues, map, unicode_type +from polyglot.builtins import itervalues, unicode_type from datetime import datetime from calibre import human_readable, prints, force_unicode diff --git a/src/calibre/devices/mtp/test.py b/src/calibre/devices/mtp/test.py index ab16043530..45a81d4d53 100644 --- a/src/calibre/devices/mtp/test.py +++ b/src/calibre/devices/mtp/test.py @@ -12,7 +12,6 @@ from calibre.constants import iswindows, islinux from calibre.utils.icu import lower from calibre.devices.mtp.driver import MTP_DEVICE from calibre.devices.scanner import DeviceScanner -from polyglot.builtins import range class ProgressCallback: diff --git a/src/calibre/devices/mtp/windows/driver.py b/src/calibre/devices/mtp/windows/driver.py index 1bb06f6e9f..73a592c662 100644 --- a/src/calibre/devices/mtp/windows/driver.py +++ b/src/calibre/devices/mtp/windows/driver.py @@ -8,7 +8,7 @@ __docformat__ = 'restructuredtext en' import time, threading, traceback from functools import wraps, partial -from polyglot.builtins import iteritems, itervalues, unicode_type, zip +from polyglot.builtins import iteritems, itervalues, unicode_type from itertools import chain from calibre import as_unicode, prints, force_unicode diff --git a/src/calibre/devices/prs505/sony_cache.py b/src/calibre/devices/prs505/sony_cache.py index d025a994f0..718c3fd5fa 100644 --- a/src/calibre/devices/prs505/sony_cache.py +++ b/src/calibre/devices/prs505/sony_cache.py @@ -17,7 +17,7 @@ from calibre.ebooks.chardet import xml_to_unicode from calibre.ebooks.metadata import authors_to_string, title_sort, \ authors_to_sort_string from polyglot.binary import from_base64_bytes -from polyglot.builtins import unicode_type, zip +from polyglot.builtins import unicode_type ''' cacheExt.xml diff --git a/src/calibre/devices/scanner.py b/src/calibre/devices/scanner.py index 9a0e6f2535..12b2119b41 100644 --- a/src/calibre/devices/scanner.py +++ b/src/calibre/devices/scanner.py @@ -13,7 +13,6 @@ from threading import Lock from calibre import prints, as_unicode from calibre.constants import (iswindows, ismacos, islinux, isfreebsd, isnetbsd) -from polyglot.builtins import range osx_scanner = linux_scanner = freebsd_scanner = netbsd_scanner = None diff --git a/src/calibre/devices/usbms/device.py b/src/calibre/devices/usbms/device.py index 18770fb816..4be336ed1f 100644 --- a/src/calibre/devices/usbms/device.py +++ b/src/calibre/devices/usbms/device.py @@ -27,7 +27,7 @@ from calibre.devices.errors import DeviceError from calibre.devices.interface import DevicePlugin from calibre.devices.usbms.deviceconfig import DeviceConfig from calibre.utils.filenames import ascii_filename as sanitize -from polyglot.builtins import iteritems, map, string_or_bytes +from polyglot.builtins import iteritems, string_or_bytes if ismacos: osx_sanitize_name_pat = re.compile(r'[.-]') diff --git a/src/calibre/devices/usbms/driver.py b/src/calibre/devices/usbms/driver.py index a0551b9d8a..7664b2f699 100644 --- a/src/calibre/devices/usbms/driver.py +++ b/src/calibre/devices/usbms/driver.py @@ -21,7 +21,7 @@ from calibre.devices.usbms.cli import CLI from calibre.devices.usbms.device import Device from calibre.devices.usbms.books import BookList, Book from calibre.ebooks.metadata.book.json_codec import JsonCodec -from polyglot.builtins import itervalues, unicode_type, string_or_bytes, zip +from polyglot.builtins import itervalues, unicode_type, string_or_bytes def debug_print(*args, **kw): diff --git a/src/calibre/devices/winusb.py b/src/calibre/devices/winusb.py index 1caed21561..f69cda94d5 100644 --- a/src/calibre/devices/winusb.py +++ b/src/calibre/devices/winusb.py @@ -13,7 +13,7 @@ from ctypes import ( ) from ctypes.wintypes import DWORD, WORD, ULONG, LPCWSTR, HWND, BOOL, LPWSTR, UINT, BYTE, HANDLE, USHORT from pprint import pprint, pformat -from polyglot.builtins import iteritems, itervalues, map, filter +from polyglot.builtins import iteritems, itervalues from calibre import prints, as_unicode diff --git a/src/calibre/ebooks/comic/input.py b/src/calibre/ebooks/comic/input.py index ae80bc6769..2ea90bad94 100644 --- a/src/calibre/ebooks/comic/input.py +++ b/src/calibre/ebooks/comic/input.py @@ -16,7 +16,7 @@ from calibre.ptempfile import PersistentTemporaryDirectory from calibre.utils.icu import numeric_sort_key from calibre.utils.ipc.server import Server from calibre.utils.ipc.job import ParallelJob -from polyglot.builtins import unicode_type, map +from polyglot.builtins import unicode_type from polyglot.queue import Empty # If the specified screen has either dimension larger than this value, no image diff --git a/src/calibre/ebooks/compression/palmdoc.py b/src/calibre/ebooks/compression/palmdoc.py index b142cefe73..9b607cb8e7 100644 --- a/src/calibre/ebooks/compression/palmdoc.py +++ b/src/calibre/ebooks/compression/palmdoc.py @@ -8,7 +8,6 @@ __copyright__ = '2008, Kovid Goyal ' import io from struct import pack -from polyglot.builtins import range from calibre_extensions import cPalmdoc diff --git a/src/calibre/ebooks/compression/tcr.py b/src/calibre/ebooks/compression/tcr.py index b13f49009f..d4ec4cc8be 100644 --- a/src/calibre/ebooks/compression/tcr.py +++ b/src/calibre/ebooks/compression/tcr.py @@ -6,7 +6,7 @@ __copyright__ = '2009, John Schember ' __docformat__ = 'restructuredtext en' import re -from polyglot.builtins import int_to_byte, range +from polyglot.builtins import int_to_byte class TCRCompressor: diff --git a/src/calibre/ebooks/conversion/plugins/comic_input.py b/src/calibre/ebooks/conversion/plugins/comic_input.py index 2983caa511..de52cbaba5 100644 --- a/src/calibre/ebooks/conversion/plugins/comic_input.py +++ b/src/calibre/ebooks/conversion/plugins/comic_input.py @@ -13,7 +13,7 @@ import shutil, textwrap, codecs, os from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation from calibre import CurrentDir from calibre.ptempfile import PersistentTemporaryDirectory -from polyglot.builtins import getcwd, map +from polyglot.builtins import getcwd class ComicInput(InputFormatPlugin): diff --git a/src/calibre/ebooks/conversion/plugins/epub_output.py b/src/calibre/ebooks/conversion/plugins/epub_output.py index ac107e32e3..10c7c513d7 100644 --- a/src/calibre/ebooks/conversion/plugins/epub_output.py +++ b/src/calibre/ebooks/conversion/plugins/epub_output.py @@ -12,7 +12,7 @@ from calibre.customize.conversion import (OutputFormatPlugin, OptionRecommendation) from calibre.ptempfile import TemporaryDirectory from calibre import CurrentDir -from polyglot.builtins import unicode_type, filter, map, zip, range, as_bytes +from polyglot.builtins import unicode_type, as_bytes block_level_tags = ( 'address', diff --git a/src/calibre/ebooks/conversion/plugins/html_input.py b/src/calibre/ebooks/conversion/plugins/html_input.py index 30d1bf6b3c..3b329879b0 100644 --- a/src/calibre/ebooks/conversion/plugins/html_input.py +++ b/src/calibre/ebooks/conversion/plugins/html_input.py @@ -17,7 +17,7 @@ from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation from calibre.utils.filenames import ascii_filename from calibre.utils.imghdr import what from calibre.utils.localization import get_lang -from polyglot.builtins import as_unicode, getcwd, unicode_type, zip +from polyglot.builtins import as_unicode, getcwd, unicode_type def sanitize_file_name(x): diff --git a/src/calibre/ebooks/conversion/plugins/rtf_input.py b/src/calibre/ebooks/conversion/plugins/rtf_input.py index c35085328b..a2b28e03ee 100644 --- a/src/calibre/ebooks/conversion/plugins/rtf_input.py +++ b/src/calibre/ebooks/conversion/plugins/rtf_input.py @@ -5,7 +5,7 @@ __copyright__ = '2008, Kovid Goyal ' import os, glob, re, textwrap from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation -from polyglot.builtins import iteritems, filter, getcwd, as_bytes +from polyglot.builtins import iteritems, getcwd, as_bytes border_style_map = { 'single' : 'solid', diff --git a/src/calibre/ebooks/conversion/plumber.py b/src/calibre/ebooks/conversion/plumber.py index 37957b4b8a..037bc1ad46 100644 --- a/src/calibre/ebooks/conversion/plumber.py +++ b/src/calibre/ebooks/conversion/plumber.py @@ -20,7 +20,7 @@ from calibre.utils.zipfile import ZipFile from calibre import (extract, walk, isbytestring, filesystem_encoding, get_types_map) from calibre.constants import __version__ -from polyglot.builtins import unicode_type, string_or_bytes, map +from polyglot.builtins import unicode_type, string_or_bytes DEBUG_README=b''' This debug folder contains snapshots of the e-book as it passes through the diff --git a/src/calibre/ebooks/conversion/preprocess.py b/src/calibre/ebooks/conversion/preprocess.py index 56887ff02d..4cf6b861aa 100644 --- a/src/calibre/ebooks/conversion/preprocess.py +++ b/src/calibre/ebooks/conversion/preprocess.py @@ -10,7 +10,7 @@ import functools, re, json from math import ceil from calibre import entity_to_unicode, as_unicode -from polyglot.builtins import unicode_type, range +from polyglot.builtins import unicode_type XMLDECL_RE = re.compile(r'^\s*<[?]xml.*?[?]>') SVG_NS = 'http://www.w3.org/2000/svg' diff --git a/src/calibre/ebooks/covers.py b/src/calibre/ebooks/covers.py index 154d84d67f..ff3dbe1801 100644 --- a/src/calibre/ebooks/covers.py +++ b/src/calibre/ebooks/covers.py @@ -9,7 +9,7 @@ import re, random, unicodedata, numbers from collections import namedtuple from contextlib import contextmanager from math import ceil, sqrt, cos, sin, atan2 -from polyglot.builtins import iteritems, itervalues, map, zip, string_or_bytes +from polyglot.builtins import iteritems, itervalues, string_or_bytes from itertools import chain from qt.core import ( diff --git a/src/calibre/ebooks/djvu/djvubzzdec.py b/src/calibre/ebooks/djvu/djvubzzdec.py index 592f78fe2e..84b8bd1a2f 100644 --- a/src/calibre/ebooks/djvu/djvubzzdec.py +++ b/src/calibre/ebooks/djvu/djvubzzdec.py @@ -2,7 +2,6 @@ # coding: utf-8 -from polyglot.builtins import range __license__ = 'GPL v3' __copyright__ = '2011, Anthon van der Neut ' diff --git a/src/calibre/ebooks/docx/cleanup.py b/src/calibre/ebooks/docx/cleanup.py index 983133200d..1231e693ec 100644 --- a/src/calibre/ebooks/docx/cleanup.py +++ b/src/calibre/ebooks/docx/cleanup.py @@ -6,7 +6,7 @@ __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal ' import os -from polyglot.builtins import itervalues, range +from polyglot.builtins import itervalues NBSP = '\xa0' diff --git a/src/calibre/ebooks/docx/fonts.py b/src/calibre/ebooks/docx/fonts.py index 9faeda731b..4235c75c60 100644 --- a/src/calibre/ebooks/docx/fonts.py +++ b/src/calibre/ebooks/docx/fonts.py @@ -13,7 +13,7 @@ from calibre.utils.filenames import ascii_filename from calibre.utils.fonts.scanner import font_scanner, NoFonts from calibre.utils.fonts.utils import panose_to_css_generic_family, is_truetype_font from calibre.utils.icu import ord_string -from polyglot.builtins import codepoint_to_chr, iteritems, range +from polyglot.builtins import codepoint_to_chr, iteritems Embed = namedtuple('Embed', 'name key subsetted') diff --git a/src/calibre/ebooks/docx/index.py b/src/calibre/ebooks/docx/index.py index 39419284c0..9be71fc7ac 100644 --- a/src/calibre/ebooks/docx/index.py +++ b/src/calibre/ebooks/docx/index.py @@ -10,7 +10,7 @@ from operator import itemgetter from lxml import etree from calibre.utils.icu import partition_by_first_letter, sort_key -from polyglot.builtins import iteritems, filter +from polyglot.builtins import iteritems def get_applicable_xe_fields(index, xe_fields, XPath, expand): diff --git a/src/calibre/ebooks/docx/tables.py b/src/calibre/ebooks/docx/tables.py index 4926325ba0..b66eb051c1 100644 --- a/src/calibre/ebooks/docx/tables.py +++ b/src/calibre/ebooks/docx/tables.py @@ -9,7 +9,7 @@ from lxml.html.builder import TABLE, TR, TD from calibre.ebooks.docx.block_styles import inherit, read_shd as rs, read_border, binary_property, border_props, ParagraphStyle, border_to_css from calibre.ebooks.docx.char_styles import RunStyle -from polyglot.builtins import filter, iteritems, itervalues, range, unicode_type +from polyglot.builtins import iteritems, itervalues, unicode_type # Read from XML {{{ read_shd = rs diff --git a/src/calibre/ebooks/docx/to_html.py b/src/calibre/ebooks/docx/to_html.py index c79b13794f..9c59cfcb05 100644 --- a/src/calibre/ebooks/docx/to_html.py +++ b/src/calibre/ebooks/docx/to_html.py @@ -28,7 +28,7 @@ from calibre.ebooks.docx.fields import Fields from calibre.ebooks.docx.settings import Settings from calibre.ebooks.metadata.opf2 import OPFCreator from calibre.utils.localization import canonicalize_lang, lang_as_iso639_1 -from polyglot.builtins import iteritems, itervalues, filter, getcwd, map, unicode_type +from polyglot.builtins import iteritems, itervalues, getcwd, unicode_type NBSP = '\xa0' diff --git a/src/calibre/ebooks/docx/toc.py b/src/calibre/ebooks/docx/toc.py index 0fb2e7ea8b..5d73af07c6 100644 --- a/src/calibre/ebooks/docx/toc.py +++ b/src/calibre/ebooks/docx/toc.py @@ -12,7 +12,7 @@ from lxml.etree import tostring from calibre.ebooks.metadata.toc import TOC from calibre.ebooks.oeb.polish.toc import elem_to_toc_text -from polyglot.builtins import iteritems, range +from polyglot.builtins import iteritems def from_headings(body, log, namespace, num_levels=3): diff --git a/src/calibre/ebooks/docx/writer/container.py b/src/calibre/ebooks/docx/writer/container.py index 413ffd64e8..1c9071a1db 100644 --- a/src/calibre/ebooks/docx/writer/container.py +++ b/src/calibre/ebooks/docx/writer/container.py @@ -18,7 +18,7 @@ from calibre.ebooks.pdf.render.common import PAPER_SIZES from calibre.utils.date import utcnow from calibre.utils.localization import canonicalize_lang, lang_as_iso639_1 from calibre.utils.zipfile import ZipFile -from polyglot.builtins import iteritems, map, unicode_type, native_string_type +from polyglot.builtins import iteritems, unicode_type, native_string_type def xml2str(root, pretty_print=False, with_tail=False): diff --git a/src/calibre/ebooks/docx/writer/fonts.py b/src/calibre/ebooks/docx/writer/fonts.py index d7bb42c786..838e060af3 100644 --- a/src/calibre/ebooks/docx/writer/fonts.py +++ b/src/calibre/ebooks/docx/writer/fonts.py @@ -10,7 +10,6 @@ from uuid import uuid4 from calibre.ebooks.oeb.base import OEB_STYLES from calibre.ebooks.oeb.transforms.subset import find_font_face_rules -from polyglot.builtins import range def obfuscate_font_data(data, key): diff --git a/src/calibre/ebooks/docx/writer/images.py b/src/calibre/ebooks/docx/writer/images.py index 546c40329c..a77a79efb0 100644 --- a/src/calibre/ebooks/docx/writer/images.py +++ b/src/calibre/ebooks/docx/writer/images.py @@ -9,7 +9,7 @@ import os import posixpath from collections import namedtuple from functools import partial -from polyglot.builtins import iteritems, itervalues, map, unicode_type +from polyglot.builtins import iteritems, itervalues, unicode_type from lxml import etree diff --git a/src/calibre/ebooks/docx/writer/styles.py b/src/calibre/ebooks/docx/writer/styles.py index 1ee8631775..ac2606c7d6 100644 --- a/src/calibre/ebooks/docx/writer/styles.py +++ b/src/calibre/ebooks/docx/writer/styles.py @@ -14,7 +14,7 @@ from lxml import etree from calibre.ebooks import parse_css_length from calibre.ebooks.docx.writer.utils import convert_color, int_or_zero from calibre.utils.localization import lang_as_iso639_1 -from polyglot.builtins import iteritems, filter, unicode_type +from polyglot.builtins import iteritems, unicode_type from tinycss.css21 import CSS21Parser css_parser = CSS21Parser() diff --git a/src/calibre/ebooks/docx/writer/tables.py b/src/calibre/ebooks/docx/writer/tables.py index 4a57ffb31e..3232f3b42a 100644 --- a/src/calibre/ebooks/docx/writer/tables.py +++ b/src/calibre/ebooks/docx/writer/tables.py @@ -9,7 +9,7 @@ from collections import namedtuple from calibre.ebooks.docx.writer.utils import convert_color from calibre.ebooks.docx.writer.styles import read_css_block_borders as rcbb, border_edges -from polyglot.builtins import iteritems, range, unicode_type +from polyglot.builtins import iteritems, unicode_type class Dummy: diff --git a/src/calibre/ebooks/epub/cfi/parse.py b/src/calibre/ebooks/epub/cfi/parse.py index 4e69ae1a16..5bdd790cde 100644 --- a/src/calibre/ebooks/epub/cfi/parse.py +++ b/src/calibre/ebooks/epub/cfi/parse.py @@ -6,7 +6,6 @@ __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal ' import regex -from polyglot.builtins import map, zip class Parser: diff --git a/src/calibre/ebooks/epub/cfi/tests.py b/src/calibre/ebooks/epub/cfi/tests.py index 5ebce70935..c97317ee85 100644 --- a/src/calibre/ebooks/epub/cfi/tests.py +++ b/src/calibre/ebooks/epub/cfi/tests.py @@ -6,7 +6,6 @@ __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal ' import unittest, numbers -from polyglot.builtins import map from calibre.ebooks.epub.cfi.parse import parser, cfi_sort_key, decode_cfi from polyglot.builtins import iteritems, unicode_type diff --git a/src/calibre/ebooks/epub/periodical.py b/src/calibre/ebooks/epub/periodical.py index 97fb17ccdb..dc6f7a0786 100644 --- a/src/calibre/ebooks/epub/periodical.py +++ b/src/calibre/ebooks/epub/periodical.py @@ -12,7 +12,7 @@ import time from calibre.constants import __appname__, __version__ from calibre import strftime, prepare_string_for_xml as xml from calibre.utils.date import parse_date -from polyglot.builtins import unicode_type, filter +from polyglot.builtins import unicode_type SONY_METADATA = '''\ diff --git a/src/calibre/ebooks/fb2/fb2ml.py b/src/calibre/ebooks/fb2/fb2ml.py index 176fc324a0..952a32e0be 100644 --- a/src/calibre/ebooks/fb2/fb2ml.py +++ b/src/calibre/ebooks/fb2/fb2ml.py @@ -20,7 +20,7 @@ from calibre.utils.localization import lang_as_iso639_1 from calibre.utils.xml_parse import safe_xml_fromstring from calibre.utils.img import save_cover_data_to from calibre.ebooks.oeb.base import urlnormalize -from polyglot.builtins import unicode_type, string_or_bytes, range, filter +from polyglot.builtins import unicode_type, string_or_bytes from polyglot.binary import as_base64_unicode from polyglot.urllib import urlparse diff --git a/src/calibre/ebooks/lit/maps/opf.py b/src/calibre/ebooks/lit/maps/opf.py index 94882c7de2..3ecf4d4587 100644 --- a/src/calibre/ebooks/lit/maps/opf.py +++ b/src/calibre/ebooks/lit/maps/opf.py @@ -7,7 +7,6 @@ __copyright__ = '2008, Marshall T. Vandegrift ' Microsoft LIT OPF tag and attribute tables, copied from ConvertLIT. """ -from polyglot.builtins import range TAGS = [ None, diff --git a/src/calibre/ebooks/lit/mssha1.py b/src/calibre/ebooks/lit/mssha1.py index 265d0ad7ea..6ab6ccaccc 100644 --- a/src/calibre/ebooks/lit/mssha1.py +++ b/src/calibre/ebooks/lit/mssha1.py @@ -9,7 +9,7 @@ __license__ = 'GPL v3' __copyright__ = '2008, Marshall T. Vandegrift ' import struct, copy -from polyglot.builtins import range, long_type +from polyglot.builtins import long_type # ====================================================================== # Bit-Manipulation helpers diff --git a/src/calibre/ebooks/lit/reader.py b/src/calibre/ebooks/lit/reader.py index 1ab059e695..f51fa50ca3 100644 --- a/src/calibre/ebooks/lit/reader.py +++ b/src/calibre/ebooks/lit/reader.py @@ -17,7 +17,7 @@ import calibre.ebooks.lit.mssha1 as mssha1 from calibre.ebooks.oeb.base import urlnormalize, xpath from calibre.ebooks.oeb.reader import OEBReader from calibre.ebooks import DRMError -from polyglot.builtins import codepoint_to_chr, unicode_type, string_or_bytes, range, itervalues +from polyglot.builtins import codepoint_to_chr, unicode_type, string_or_bytes, itervalues from polyglot.urllib import unquote as urlunquote, urldefrag from calibre_extensions import lzx, msdes diff --git a/src/calibre/ebooks/lit/writer.py b/src/calibre/ebooks/lit/writer.py index 9f9c005a8b..45425c9a2d 100644 --- a/src/calibre/ebooks/lit/writer.py +++ b/src/calibre/ebooks/lit/writer.py @@ -29,7 +29,7 @@ from calibre.ebooks.lit.lzx import Compressor import calibre from calibre_extensions import msdes import calibre.ebooks.lit.mssha1 as mssha1 -from polyglot.builtins import codepoint_to_chr, unicode_type, string_or_bytes, range, zip, native_string_type +from polyglot.builtins import codepoint_to_chr, unicode_type, string_or_bytes, native_string_type from polyglot.urllib import urldefrag, unquote __all__ = ['LitWriter'] diff --git a/src/calibre/ebooks/lrf/html/table.py b/src/calibre/ebooks/lrf/html/table.py index a7c953fc12..46c05fb3ab 100644 --- a/src/calibre/ebooks/lrf/html/table.py +++ b/src/calibre/ebooks/lrf/html/table.py @@ -8,7 +8,7 @@ from calibre.ebooks.lrf.fonts import get_font from calibre.ebooks.lrf.pylrs.pylrs import TextBlock, Text, CR, Span, \ CharButton, Plot, Paragraph, \ LrsTextTag -from polyglot.builtins import string_or_bytes, range, native_string_type +from polyglot.builtins import string_or_bytes, native_string_type def ceil(num): diff --git a/src/calibre/ebooks/lrf/input.py b/src/calibre/ebooks/lrf/input.py index aff106875d..bd94b80889 100644 --- a/src/calibre/ebooks/lrf/input.py +++ b/src/calibre/ebooks/lrf/input.py @@ -12,7 +12,7 @@ from copy import deepcopy, copy from lxml import etree from calibre import guess_type -from polyglot.builtins import as_bytes, map, unicode_type +from polyglot.builtins import as_bytes, unicode_type class Canvas(etree.XSLTExtension): diff --git a/src/calibre/ebooks/metadata/__init__.py b/src/calibre/ebooks/metadata/__init__.py index 9dbe47d699..27328b3ba6 100644 --- a/src/calibre/ebooks/metadata/__init__.py +++ b/src/calibre/ebooks/metadata/__init__.py @@ -14,7 +14,7 @@ from contextlib import suppress from calibre import relpath, guess_type, prints, force_unicode from calibre.utils.config_base import tweaks -from polyglot.builtins import codepoint_to_chr, unicode_type, range, map, zip, getcwd, iteritems, as_unicode +from polyglot.builtins import codepoint_to_chr, unicode_type, getcwd, iteritems, as_unicode from polyglot.urllib import quote, unquote, urlparse diff --git a/src/calibre/ebooks/metadata/archive.py b/src/calibre/ebooks/metadata/archive.py index b04c1bdb35..425a8fb3da 100644 --- a/src/calibre/ebooks/metadata/archive.py +++ b/src/calibre/ebooks/metadata/archive.py @@ -11,7 +11,7 @@ from contextlib import closing from calibre.customize import FileTypePlugin from calibre.utils.localization import canonicalize_lang -from polyglot.builtins import filter, unicode_type +from polyglot.builtins import unicode_type def is_comic(list_of_names): diff --git a/src/calibre/ebooks/metadata/author_mapper.py b/src/calibre/ebooks/metadata/author_mapper.py index 922ca7770c..2b81183a74 100644 --- a/src/calibre/ebooks/metadata/author_mapper.py +++ b/src/calibre/ebooks/metadata/author_mapper.py @@ -7,7 +7,7 @@ import re from collections import deque from calibre.utils.icu import capitalize, lower, upper -from polyglot.builtins import filter, unicode_type +from polyglot.builtins import unicode_type def cap_author_token(token): diff --git a/src/calibre/ebooks/metadata/book/base.py b/src/calibre/ebooks/metadata/book/base.py index f3f20c224a..11b959092a 100644 --- a/src/calibre/ebooks/metadata/book/base.py +++ b/src/calibre/ebooks/metadata/book/base.py @@ -15,7 +15,7 @@ from calibre.ebooks.metadata.book import (SC_COPYABLE_FIELDS, TOP_LEVEL_IDENTIFIERS, ALL_METADATA_FIELDS) from calibre.library.field_metadata import FieldMetadata from calibre.utils.icu import sort_key -from polyglot.builtins import iteritems, unicode_type, filter, map, string_or_bytes +from polyglot.builtins import iteritems, unicode_type, string_or_bytes # Special sets used to optimize the performance of getting and setting # attributes on Metadata objects diff --git a/src/calibre/ebooks/metadata/book/render.py b/src/calibre/ebooks/metadata/book/render.py index 2cb9ee201a..41b3d847f6 100644 --- a/src/calibre/ebooks/metadata/book/render.py +++ b/src/calibre/ebooks/metadata/book/render.py @@ -19,7 +19,6 @@ from calibre.utils.formatter import EvalFormatter from calibre.utils.date import is_date_undefined from calibre.utils.localization import calibre_langcode_to_name from calibre.utils.serialize import json_dumps -from polyglot.builtins import filter from polyglot.binary import as_hex_unicode default_sort = ('title', 'title_sort', 'authors', 'author_sort', 'series', 'rating', 'pubdate', 'tags', 'publisher', 'identifiers') diff --git a/src/calibre/ebooks/metadata/kdl.py b/src/calibre/ebooks/metadata/kdl.py index 104894b514..80ccd398c2 100644 --- a/src/calibre/ebooks/metadata/kdl.py +++ b/src/calibre/ebooks/metadata/kdl.py @@ -14,7 +14,7 @@ from calibre.ebooks.metadata.book.base import Metadata from calibre import browser from calibre.ebooks.BeautifulSoup import BeautifulSoup from calibre.ebooks.chardet import xml_to_unicode -from polyglot.builtins import codepoint_to_chr, unicode_type, range +from polyglot.builtins import codepoint_to_chr, unicode_type from polyglot.urllib import parse_qs, quote_plus URL = \ diff --git a/src/calibre/ebooks/metadata/kfx.py b/src/calibre/ebooks/metadata/kfx.py index c73733ae9e..38c33c08a4 100644 --- a/src/calibre/ebooks/metadata/kfx.py +++ b/src/calibre/ebooks/metadata/kfx.py @@ -16,7 +16,7 @@ from calibre.utils.config_base import tweaks from calibre.utils.date import parse_only_date from calibre.utils.localization import canonicalize_lang from calibre.utils.imghdr import identify -from polyglot.builtins import unicode_type, filter, map +from polyglot.builtins import unicode_type from polyglot.binary import as_base64_bytes, from_base64_bytes diff --git a/src/calibre/ebooks/metadata/mobi.py b/src/calibre/ebooks/metadata/mobi.py index f6874260c7..f6d0b89d9c 100644 --- a/src/calibre/ebooks/metadata/mobi.py +++ b/src/calibre/ebooks/metadata/mobi.py @@ -15,7 +15,7 @@ from calibre.ebooks.mobi.utils import rescale_image from calibre.utils.date import now as nowf from calibre.utils.imghdr import what from calibre.utils.localization import canonicalize_lang, lang_as_iso639_1 -from polyglot.builtins import codepoint_to_chr, range, unicode_type +from polyglot.builtins import codepoint_to_chr, unicode_type ''' diff --git a/src/calibre/ebooks/metadata/opf2.py b/src/calibre/ebooks/metadata/opf2.py index 3f4503653d..9561213367 100644 --- a/src/calibre/ebooks/metadata/opf2.py +++ b/src/calibre/ebooks/metadata/opf2.py @@ -24,7 +24,7 @@ from calibre import prints, guess_type from calibre.utils.cleantext import clean_ascii_chars, clean_xml_chars from calibre.utils.config import tweaks from calibre.utils.xml_parse import safe_xml_fromstring -from polyglot.builtins import iteritems, unicode_type, getcwd, map +from polyglot.builtins import iteritems, unicode_type, getcwd from polyglot.urllib import unquote, urlparse pretty_print_opf = False diff --git a/src/calibre/ebooks/metadata/opf3.py b/src/calibre/ebooks/metadata/opf3.py index 3c071fd2e3..60b6e951f7 100644 --- a/src/calibre/ebooks/metadata/opf3.py +++ b/src/calibre/ebooks/metadata/opf3.py @@ -7,7 +7,7 @@ import json import re from collections import defaultdict, namedtuple from functools import wraps -from polyglot.builtins import iteritems, map, filter +from polyglot.builtins import iteritems from lxml import etree diff --git a/src/calibre/ebooks/metadata/plucker.py b/src/calibre/ebooks/metadata/plucker.py index 89deaa40a6..0403879a4b 100644 --- a/src/calibre/ebooks/metadata/plucker.py +++ b/src/calibre/ebooks/metadata/plucker.py @@ -16,7 +16,6 @@ from calibre.ebooks.metadata import MetaInformation from calibre.ebooks.pdb.header import PdbHeaderReader from calibre.ebooks.pdb.plucker.reader import SectionHeader, DATATYPE_METADATA, \ MIBNUM_TO_NAME -from polyglot.builtins import range def get_metadata(stream, extract_cover=True): diff --git a/src/calibre/ebooks/metadata/rtf.py b/src/calibre/ebooks/metadata/rtf.py index f425137321..b8d621aaba 100644 --- a/src/calibre/ebooks/metadata/rtf.py +++ b/src/calibre/ebooks/metadata/rtf.py @@ -11,7 +11,7 @@ import re from calibre import force_unicode from calibre.ebooks.metadata import MetaInformation -from polyglot.builtins import codepoint_to_chr, string_or_bytes, unicode_type, int_to_byte, filter +from polyglot.builtins import codepoint_to_chr, string_or_bytes, unicode_type, int_to_byte title_pat = re.compile(br'\{\\info.*?\{\\title(.*?)(?]+encoding\s*=\s*[\'"](.*?)[\'"][^<>]*>', re.IGNORECASE) diff --git a/src/calibre/ebooks/mobi/debug/containers.py b/src/calibre/ebooks/mobi/debug/containers.py index beb558f4c5..bc1453ebb0 100644 --- a/src/calibre/ebooks/mobi/debug/containers.py +++ b/src/calibre/ebooks/mobi/debug/containers.py @@ -8,7 +8,7 @@ __copyright__ = '2014, Kovid Goyal ' from struct import unpack_from from calibre.ebooks.mobi.debug.headers import EXTHHeader -from polyglot.builtins import filter, unicode_type +from polyglot.builtins import unicode_type class ContainerHeader: diff --git a/src/calibre/ebooks/mobi/debug/headers.py b/src/calibre/ebooks/mobi/debug/headers.py index 707ae3adac..edbaff43fc 100644 --- a/src/calibre/ebooks/mobi/debug/headers.py +++ b/src/calibre/ebooks/mobi/debug/headers.py @@ -13,7 +13,7 @@ from calibre.ebooks.mobi.reader.headers import NULL_INDEX from calibre.ebooks.mobi.langcodes import main_language, sub_language from calibre.ebooks.mobi.debug import format_bytes from calibre.ebooks.mobi.utils import get_trailing_data -from polyglot.builtins import iteritems, range, unicode_type +from polyglot.builtins import iteritems, unicode_type # PalmDB {{{ diff --git a/src/calibre/ebooks/mobi/debug/index.py b/src/calibre/ebooks/mobi/debug/index.py index 23fc92989a..e934f83fd4 100644 --- a/src/calibre/ebooks/mobi/debug/index.py +++ b/src/calibre/ebooks/mobi/debug/index.py @@ -14,7 +14,7 @@ from calibre.ebooks.mobi.reader.headers import NULL_INDEX from calibre.ebooks.mobi.reader.index import (CNCX, parse_indx_header, parse_tagx_section, parse_index_record, INDEX_HEADER_FIELDS) from calibre.ebooks.mobi.reader.ncx import (tag_fieldname_map, default_entry) -from polyglot.builtins import iteritems, range +from polyglot.builtins import iteritems File = namedtuple('File', 'file_number name divtbl_count start_position length') diff --git a/src/calibre/ebooks/mobi/debug/mobi6.py b/src/calibre/ebooks/mobi/debug/mobi6.py index b9fa965946..f0dc120030 100644 --- a/src/calibre/ebooks/mobi/debug/mobi6.py +++ b/src/calibre/ebooks/mobi/debug/mobi6.py @@ -19,7 +19,7 @@ from calibre.ebooks.mobi.utils import (decode_hex_number, decint, from calibre.utils.imghdr import what from calibre.ebooks.mobi.debug import format_bytes from calibre.ebooks.mobi.debug.headers import TextRecord -from polyglot.builtins import unicode_type, range, iteritems, as_bytes, print_to_binary_file +from polyglot.builtins import unicode_type, iteritems, as_bytes, print_to_binary_file class TagX: # {{{ diff --git a/src/calibre/ebooks/mobi/debug/mobi8.py b/src/calibre/ebooks/mobi/debug/mobi8.py index c268510fbe..66e4bbe948 100644 --- a/src/calibre/ebooks/mobi/debug/mobi8.py +++ b/src/calibre/ebooks/mobi/debug/mobi8.py @@ -17,7 +17,7 @@ from calibre.ebooks.mobi.utils import read_font_record, decode_tbs, RECORD_SIZE from calibre.ebooks.mobi.debug import format_bytes from calibre.ebooks.mobi.reader.headers import NULL_INDEX from calibre.utils.imghdr import what -from polyglot.builtins import iteritems, itervalues, map, unicode_type, zip, print_to_binary_file +from polyglot.builtins import iteritems, itervalues, unicode_type, print_to_binary_file class FDST: diff --git a/src/calibre/ebooks/mobi/huffcdic.py b/src/calibre/ebooks/mobi/huffcdic.py index 63f78b5c41..c17d4096df 100644 --- a/src/calibre/ebooks/mobi/huffcdic.py +++ b/src/calibre/ebooks/mobi/huffcdic.py @@ -14,7 +14,6 @@ and igorsk. import struct from calibre.ebooks.mobi import MobiError -from polyglot.builtins import map class Reader: diff --git a/src/calibre/ebooks/mobi/reader/index.py b/src/calibre/ebooks/mobi/reader/index.py index e6338a6535..713cb74ae6 100644 --- a/src/calibre/ebooks/mobi/reader/index.py +++ b/src/calibre/ebooks/mobi/reader/index.py @@ -11,7 +11,7 @@ from collections import OrderedDict, namedtuple from calibre.ebooks.mobi.utils import (decint, count_set_bits, decode_string) -from polyglot.builtins import iteritems, range, zip +from polyglot.builtins import iteritems TagX = namedtuple('TagX', 'tag num_of_values bitmask eof') PTagX = namedtuple('PTagX', 'tag value_count value_bytes num_of_values') diff --git a/src/calibre/ebooks/mobi/reader/mobi6.py b/src/calibre/ebooks/mobi/reader/mobi6.py index 767dc5838e..afa13812cb 100644 --- a/src/calibre/ebooks/mobi/reader/mobi6.py +++ b/src/calibre/ebooks/mobi/reader/mobi6.py @@ -28,7 +28,7 @@ from calibre.utils.cleantext import clean_ascii_chars, clean_xml_chars from calibre.utils.img import AnimatedGIF, gif_data_to_png_data, save_cover_data_to from calibre.utils.imghdr import what from calibre.utils.logging import default_log -from polyglot.builtins import iteritems, map, range, unicode_type +from polyglot.builtins import iteritems, unicode_type class TopazError(ValueError): diff --git a/src/calibre/ebooks/mobi/reader/mobi8.py b/src/calibre/ebooks/mobi/reader/mobi8.py index c23e0c3b30..15d58560d2 100644 --- a/src/calibre/ebooks/mobi/reader/mobi8.py +++ b/src/calibre/ebooks/mobi/reader/mobi8.py @@ -23,7 +23,7 @@ from calibre.ebooks.metadata.toc import TOC from calibre.ebooks.mobi.utils import read_font_record from calibre.ebooks.oeb.parse_utils import parse_html from calibre.ebooks.oeb.base import XPath, XHTML, xml2text -from polyglot.builtins import range, zip, unicode_type, getcwd, as_unicode +from polyglot.builtins import unicode_type, getcwd, as_unicode from polyglot.urllib import urldefrag Part = namedtuple('Part', diff --git a/src/calibre/ebooks/mobi/utils.py b/src/calibre/ebooks/mobi/utils.py index 590f21fc2d..cf5f92aaf9 100644 --- a/src/calibre/ebooks/mobi/utils.py +++ b/src/calibre/ebooks/mobi/utils.py @@ -13,7 +13,7 @@ from io import BytesIO from calibre.utils.img import save_cover_data_to, scale_image, image_to_data, image_from_data, resize_image, png_data_to_gif_data from calibre.utils.imghdr import what from calibre.ebooks import normalize -from polyglot.builtins import unicode_type, range, as_bytes, map +from polyglot.builtins import unicode_type, as_bytes from tinycss.color3 import parse_color_string IMAGE_MAX_SIZE = 10 * 1024 * 1024 diff --git a/src/calibre/ebooks/mobi/writer2/indexer.py b/src/calibre/ebooks/mobi/writer2/indexer.py index b264fd0dfa..8e7dcf0a58 100644 --- a/src/calibre/ebooks/mobi/writer2/indexer.py +++ b/src/calibre/ebooks/mobi/writer2/indexer.py @@ -13,7 +13,7 @@ from collections import OrderedDict, defaultdict from calibre.ebooks.mobi.utils import (encint, encode_number_as_hex, encode_tbs, align_block, RECORD_SIZE, CNCX as CNCX_) -from polyglot.builtins import filter, iteritems, itervalues, map, range +from polyglot.builtins import iteritems, itervalues class CNCX(CNCX_): # {{{ diff --git a/src/calibre/ebooks/mobi/writer2/main.py b/src/calibre/ebooks/mobi/writer2/main.py index f28f7876d0..4a2de0979e 100644 --- a/src/calibre/ebooks/mobi/writer2/main.py +++ b/src/calibre/ebooks/mobi/writer2/main.py @@ -18,7 +18,7 @@ from calibre.ebooks.mobi.writer2 import (PALMDOC, UNCOMPRESSED) from calibre.ebooks.mobi.utils import (encint, encode_trailing_data, align_block, detect_periodical, RECORD_SIZE, create_text_record) from calibre.ebooks.mobi.writer2.indexer import Indexer -from polyglot.builtins import iteritems, unicode_type, range +from polyglot.builtins import iteritems, unicode_type # Disabled as I dont care about uncrossable breaks WRITE_UNCROSSABLE_BREAKS = False diff --git a/src/calibre/ebooks/mobi/writer8/index.py b/src/calibre/ebooks/mobi/writer8/index.py index 5b80b9963b..72af8b21d4 100644 --- a/src/calibre/ebooks/mobi/writer8/index.py +++ b/src/calibre/ebooks/mobi/writer8/index.py @@ -1,8 +1,6 @@ #!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai -from polyglot.builtins import map - __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal ' __docformat__ = 'restructuredtext en' @@ -10,7 +8,7 @@ __docformat__ = 'restructuredtext en' from collections import namedtuple from struct import pack from io import BytesIO -from polyglot.builtins import unicode_type, zip, range +from polyglot.builtins import unicode_type from calibre.ebooks.mobi.utils import CNCX, encint, align_block from calibre.ebooks.mobi.writer8.header import Header diff --git a/src/calibre/ebooks/odt/input.py b/src/calibre/ebooks/odt/input.py index 76adcf9d0e..86cca094c4 100644 --- a/src/calibre/ebooks/odt/input.py +++ b/src/calibre/ebooks/odt/input.py @@ -20,7 +20,7 @@ from odf.namespaces import TEXTNS as odTEXTNS from calibre import CurrentDir, walk from calibre.ebooks.oeb.base import _css_logger from calibre.utils.xml_parse import safe_xml_fromstring -from polyglot.builtins import unicode_type, string_or_bytes, filter, getcwd, as_bytes +from polyglot.builtins import unicode_type, string_or_bytes, getcwd, as_bytes class Extract(ODF2XHTML): diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index 11ce2ab2f5..dd1fd20d2d 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -22,7 +22,7 @@ from calibre import (isbytestring, as_unicode, get_types_map) from calibre.ebooks.oeb.parse_utils import barename, XHTML_NS, namespace, XHTML, parse_html, NotHTML from calibre.utils.cleantext import clean_xml_chars from calibre.utils.short_uuid import uuid4 -from polyglot.builtins import iteritems, unicode_type, string_or_bytes, range, itervalues, filter, codepoint_to_chr +from polyglot.builtins import iteritems, unicode_type, string_or_bytes, itervalues, codepoint_to_chr from polyglot.urllib import unquote as urlunquote, urldefrag, urljoin, urlparse, urlunparse from calibre.utils.icu import numeric_sort_key diff --git a/src/calibre/ebooks/oeb/iterator/spine.py b/src/calibre/ebooks/oeb/iterator/spine.py index 24ab3f6d79..dc615a5cbb 100644 --- a/src/calibre/ebooks/oeb/iterator/spine.py +++ b/src/calibre/ebooks/oeb/iterator/spine.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai -from polyglot.builtins import map, unicode_type +from polyglot.builtins import unicode_type __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal ' diff --git a/src/calibre/ebooks/oeb/normalize_css.py b/src/calibre/ebooks/oeb/normalize_css.py index cb8353bfcd..9ed7efbd59 100644 --- a/src/calibre/ebooks/oeb/normalize_css.py +++ b/src/calibre/ebooks/oeb/normalize_css.py @@ -12,7 +12,7 @@ from css_parser.css import PropertyValue from css_parser import profile as cssprofiles, CSSParser from tinycss.fonts3 import parse_font, serialize_font_family from calibre.ebooks.oeb.base import css_text -from polyglot.builtins import iteritems, string_or_bytes, unicode_type, zip +from polyglot.builtins import iteritems, string_or_bytes, unicode_type DEFAULTS = {'azimuth': 'center', 'background-attachment': 'scroll', # {{{ 'background-color': 'transparent', 'background-image': 'none', diff --git a/src/calibre/ebooks/oeb/parse_utils.py b/src/calibre/ebooks/oeb/parse_utils.py index b7e96a4b01..7667534160 100644 --- a/src/calibre/ebooks/oeb/parse_utils.py +++ b/src/calibre/ebooks/oeb/parse_utils.py @@ -14,7 +14,7 @@ from calibre import xml_replace_entities, force_unicode from calibre.utils.xml_parse import safe_xml_fromstring from calibre.constants import filesystem_encoding from calibre.ebooks.chardet import xml_to_unicode, strip_encoding_declarations -from polyglot.builtins import iteritems, itervalues, unicode_type, string_or_bytes, map +from polyglot.builtins import iteritems, itervalues, unicode_type, string_or_bytes RECOVER_PARSER = etree.XMLParser(recover=True, no_network=True, resolve_entities=False) XHTML_NS = 'http://www.w3.org/1999/xhtml' diff --git a/src/calibre/ebooks/oeb/polish/check/base.py b/src/calibre/ebooks/oeb/polish/check/base.py index 0a9be5bb7b..292ebfe51e 100644 --- a/src/calibre/ebooks/oeb/polish/check/base.py +++ b/src/calibre/ebooks/oeb/polish/check/base.py @@ -10,7 +10,6 @@ from functools import partial from contextlib import closing from calibre import detect_ncpus as cpu_count -from polyglot.builtins import range DEBUG, INFO, WARN, ERROR, CRITICAL = range(5) diff --git a/src/calibre/ebooks/oeb/polish/check/links.py b/src/calibre/ebooks/oeb/polish/check/links.py index 575377c132..5f118394b6 100644 --- a/src/calibre/ebooks/oeb/polish/check/links.py +++ b/src/calibre/ebooks/oeb/polish/check/links.py @@ -17,7 +17,7 @@ from calibre.ebooks.oeb.polish.replace import remove_links_to from calibre.ebooks.oeb.polish.cover import get_raster_cover_name from calibre.ebooks.oeb.polish.utils import guess_type, actual_case_for_name, corrected_case_for_name from calibre.ebooks.oeb.polish.check.base import BaseError, WARN, INFO -from polyglot.builtins import iteritems, map, range, itervalues +from polyglot.builtins import iteritems, itervalues from polyglot.urllib import urlparse from polyglot.queue import Queue, Empty diff --git a/src/calibre/ebooks/oeb/polish/check/main.py b/src/calibre/ebooks/oeb/polish/check/main.py index d72d292799..4d84c5e5a8 100644 --- a/src/calibre/ebooks/oeb/polish/check/main.py +++ b/src/calibre/ebooks/oeb/polish/check/main.py @@ -5,7 +5,7 @@ __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal ' -from polyglot.builtins import iteritems, map +from polyglot.builtins import iteritems from calibre.ebooks.oeb.base import OEB_DOCS, OEB_STYLES from calibre.ebooks.oeb.polish.utils import guess_type diff --git a/src/calibre/ebooks/oeb/polish/container.py b/src/calibre/ebooks/oeb/polish/container.py index f15ca81fab..a8f92846a0 100644 --- a/src/calibre/ebooks/oeb/polish/container.py +++ b/src/calibre/ebooks/oeb/polish/container.py @@ -51,7 +51,7 @@ from calibre.utils.ipc.simple_worker import WorkerError, fork_job from calibre.utils.logging import default_log from calibre.utils.xml_parse import safe_xml_fromstring from calibre.utils.zipfile import ZipFile -from polyglot.builtins import iteritems, map, unicode_type, zip +from polyglot.builtins import iteritems, unicode_type from polyglot.urllib import urlparse exists, join, relpath = os.path.exists, os.path.join, os.path.relpath diff --git a/src/calibre/ebooks/oeb/polish/css.py b/src/calibre/ebooks/oeb/polish/css.py index be78c33f9c..e53185ab2f 100644 --- a/src/calibre/ebooks/oeb/polish/css.py +++ b/src/calibre/ebooks/oeb/polish/css.py @@ -19,7 +19,7 @@ from calibre.ebooks.oeb.normalize_css import normalize_filter_css, normalizers from calibre.ebooks.oeb.polish.pretty import pretty_script_or_style, pretty_xml_tree, serialize from calibre.utils.icu import numeric_sort_key from css_selectors import Select, SelectorError -from polyglot.builtins import iteritems, itervalues, unicode_type, filter +from polyglot.builtins import iteritems, itervalues, unicode_type from polyglot.functools import lru_cache diff --git a/src/calibre/ebooks/oeb/polish/embed.py b/src/calibre/ebooks/oeb/polish/embed.py index 7937ce7f89..cc0b08e461 100644 --- a/src/calibre/ebooks/oeb/polish/embed.py +++ b/src/calibre/ebooks/oeb/polish/embed.py @@ -7,7 +7,6 @@ __copyright__ = '2013, Kovid Goyal ' __docformat__ = 'restructuredtext en' import sys -from polyglot.builtins import map from lxml import etree diff --git a/src/calibre/ebooks/oeb/polish/fonts.py b/src/calibre/ebooks/oeb/polish/fonts.py index 6af8921457..f083021332 100644 --- a/src/calibre/ebooks/oeb/polish/fonts.py +++ b/src/calibre/ebooks/oeb/polish/fonts.py @@ -9,7 +9,7 @@ from calibre.ebooks.oeb.base import css_text from calibre.ebooks.oeb.polish.container import OEB_STYLES, OEB_DOCS from calibre.ebooks.oeb.normalize_css import normalize_font from tinycss.fonts3 import parse_font_family, parse_font, serialize_font_family, serialize_font -from polyglot.builtins import iteritems, filter +from polyglot.builtins import iteritems def unquote(x): diff --git a/src/calibre/ebooks/oeb/polish/images.py b/src/calibre/ebooks/oeb/polish/images.py index 1b62a5ff83..7d325d92b9 100644 --- a/src/calibre/ebooks/oeb/polish/images.py +++ b/src/calibre/ebooks/oeb/polish/images.py @@ -8,7 +8,7 @@ from functools import partial from threading import Thread, Event from calibre import detect_ncpus, human_readable, force_unicode, filesystem_encoding -from polyglot.builtins import iteritems, range +from polyglot.builtins import iteritems from polyglot.queue import Queue, Empty diff --git a/src/calibre/ebooks/oeb/polish/pretty.py b/src/calibre/ebooks/oeb/polish/pretty.py index 3916cd2faa..005699f964 100644 --- a/src/calibre/ebooks/oeb/polish/pretty.py +++ b/src/calibre/ebooks/oeb/polish/pretty.py @@ -6,7 +6,7 @@ __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal ' import textwrap -from polyglot.builtins import iteritems, map +from polyglot.builtins import iteritems # from lxml.etree import Element diff --git a/src/calibre/ebooks/oeb/polish/replace.py b/src/calibre/ebooks/oeb/polish/replace.py index 0da3cf7f66..627c5ec3b5 100644 --- a/src/calibre/ebooks/oeb/polish/replace.py +++ b/src/calibre/ebooks/oeb/polish/replace.py @@ -7,7 +7,7 @@ __copyright__ = '2013, Kovid Goyal ' __docformat__ = 'restructuredtext en' import codecs, shutil, os, posixpath -from polyglot.builtins import iteritems, itervalues, map +from polyglot.builtins import iteritems, itervalues from functools import partial from collections import Counter, defaultdict diff --git a/src/calibre/ebooks/oeb/polish/spell.py b/src/calibre/ebooks/oeb/polish/spell.py index 9aad8282d1..ed8538ed48 100644 --- a/src/calibre/ebooks/oeb/polish/spell.py +++ b/src/calibre/ebooks/oeb/polish/spell.py @@ -16,7 +16,7 @@ from calibre.ebooks.oeb.polish.container import OPF_NAMESPACES, get_container from calibre.ebooks.oeb.polish.parsing import parse from calibre.ebooks.oeb.polish.toc import find_existing_ncx_toc, find_existing_nav_toc from calibre.utils.icu import ord_string -from polyglot.builtins import iteritems, unicode_type, filter +from polyglot.builtins import iteritems, unicode_type _patterns = None diff --git a/src/calibre/ebooks/oeb/polish/split.py b/src/calibre/ebooks/oeb/polish/split.py index e1660af443..ab9b5a8722 100644 --- a/src/calibre/ebooks/oeb/polish/split.py +++ b/src/calibre/ebooks/oeb/polish/split.py @@ -6,7 +6,7 @@ __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal ' import copy, os, re -from polyglot.builtins import map, string_or_bytes, range +from polyglot.builtins import string_or_bytes from calibre.ebooks.oeb.base import barename, XPNSMAP, XPath, OPF, XHTML, OEB_DOCS from calibre.ebooks.oeb.polish.errors import MalformedMarkup diff --git a/src/calibre/ebooks/oeb/polish/stats.py b/src/calibre/ebooks/oeb/polish/stats.py index 30b13289c1..18adad29d0 100644 --- a/src/calibre/ebooks/oeb/polish/stats.py +++ b/src/calibre/ebooks/oeb/polish/stats.py @@ -15,7 +15,7 @@ import regex from calibre.ebooks.oeb.base import XHTML, css_text from calibre.ebooks.oeb.polish.cascade import iterrules, resolve_styles, iterdeclaration from calibre.utils.icu import ord_string, safe_chr -from polyglot.builtins import iteritems, itervalues, range, unicode_type +from polyglot.builtins import iteritems, itervalues, unicode_type from tinycss.fonts3 import parse_font_family diff --git a/src/calibre/ebooks/oeb/polish/tests/parsing.py b/src/calibre/ebooks/oeb/polish/tests/parsing.py index 383057465a..9f5df26063 100644 --- a/src/calibre/ebooks/oeb/polish/tests/parsing.py +++ b/src/calibre/ebooks/oeb/polish/tests/parsing.py @@ -14,7 +14,7 @@ from calibre.ebooks.oeb.polish.tests.base import BaseTest from calibre.ebooks.oeb.polish.parsing import parse_html5 as parse from calibre.ebooks.oeb.base import XPath, XHTML_NS, SVG_NS, XLINK_NS from calibre.ebooks.oeb.parse_utils import html5_parse -from polyglot.builtins import iteritems, range +from polyglot.builtins import iteritems def nonvoid_cdata_elements(test, parse_function): diff --git a/src/calibre/ebooks/oeb/polish/toc.py b/src/calibre/ebooks/oeb/polish/toc.py index adf1a9e3fc..6d23bc2fb6 100644 --- a/src/calibre/ebooks/oeb/polish/toc.py +++ b/src/calibre/ebooks/oeb/polish/toc.py @@ -23,7 +23,7 @@ from calibre.ebooks.oeb.polish.opf import set_guide_item, get_book_language from calibre.ebooks.oeb.polish.pretty import pretty_html_tree from calibre.translations.dynamic import translate from calibre.utils.localization import get_lang, canonicalize_lang, lang_as_iso639_1 -from polyglot.builtins import iteritems, map, unicode_type +from polyglot.builtins import iteritems, unicode_type from polyglot.urllib import urlparse ns = etree.FunctionNamespace('calibre_xpath_extensions') diff --git a/src/calibre/ebooks/oeb/polish/utils.py b/src/calibre/ebooks/oeb/polish/utils.py index 658e2cb72f..39191ebcfa 100644 --- a/src/calibre/ebooks/oeb/polish/utils.py +++ b/src/calibre/ebooks/oeb/polish/utils.py @@ -9,7 +9,6 @@ import re, os from bisect import bisect from calibre import guess_type as _guess_type, replace_entities -from polyglot.builtins import filter def guess_type(x): diff --git a/src/calibre/ebooks/oeb/reader.py b/src/calibre/ebooks/oeb/reader.py index 6031856d76..4037cbe98f 100644 --- a/src/calibre/ebooks/oeb/reader.py +++ b/src/calibre/ebooks/oeb/reader.py @@ -27,7 +27,7 @@ from calibre.utils.localization import get_lang from calibre.ptempfile import TemporaryDirectory from calibre.constants import __appname__, __version__ from calibre import guess_type, xml_replace_entities -from polyglot.builtins import unicode_type, zip +from polyglot.builtins import unicode_type from polyglot.urllib import unquote, urldefrag, urlparse __all__ = ['OEBReader'] diff --git a/src/calibre/ebooks/oeb/stylizer.py b/src/calibre/ebooks/oeb/stylizer.py index 9e36083589..dc129b3bce 100644 --- a/src/calibre/ebooks/oeb/stylizer.py +++ b/src/calibre/ebooks/oeb/stylizer.py @@ -21,7 +21,7 @@ from calibre.ebooks import unit_convert from calibre.ebooks.oeb.base import XHTML, XHTML_NS, CSS_MIME, OEB_STYLES, xpath, urlnormalize from calibre.ebooks.oeb.normalize_css import DEFAULTS, normalizers from css_selectors import Select, SelectorError, INAPPROPRIATE_PSEUDO_CLASSES -from polyglot.builtins import iteritems, unicode_type, filter +from polyglot.builtins import iteritems, unicode_type from tinycss.media3 import CSSMedia3Parser css_parser_log.setLevel(logging.WARN) diff --git a/src/calibre/ebooks/oeb/transforms/flatcss.py b/src/calibre/ebooks/oeb/transforms/flatcss.py index a7eb4b25de..b0bf43984f 100644 --- a/src/calibre/ebooks/oeb/transforms/flatcss.py +++ b/src/calibre/ebooks/oeb/transforms/flatcss.py @@ -21,7 +21,7 @@ from calibre.ebooks.oeb.base import (XHTML, XHTML_NS, CSS_MIME, OEB_STYLES, from calibre.ebooks.oeb.stylizer import Stylizer from calibre.utils.filenames import ascii_filename, ascii_text from calibre.utils.icu import numeric_sort_key -from polyglot.builtins import iteritems, unicode_type, string_or_bytes, map +from polyglot.builtins import iteritems, unicode_type, string_or_bytes COLLAPSE = re.compile(r'[ \t\r\n\v]+') STRIPNUM = re.compile(r'[-0-9]+$') diff --git a/src/calibre/ebooks/oeb/transforms/jacket.py b/src/calibre/ebooks/oeb/transforms/jacket.py index 87859f6790..8b08e40ba1 100644 --- a/src/calibre/ebooks/oeb/transforms/jacket.py +++ b/src/calibre/ebooks/oeb/transforms/jacket.py @@ -25,7 +25,7 @@ from calibre.library.comments import comments_to_html, markdown from calibre.utils.config import tweaks from calibre.utils.date import as_local_time, format_date, is_date_undefined from calibre.utils.icu import sort_key -from polyglot.builtins import map, unicode_type +from polyglot.builtins import unicode_type JACKET_XPATH = '//h:meta[@name="calibre-content" and @content="jacket"]' diff --git a/src/calibre/ebooks/oeb/transforms/split.py b/src/calibre/ebooks/oeb/transforms/split.py index 0c5885af93..9e3033239d 100644 --- a/src/calibre/ebooks/oeb/transforms/split.py +++ b/src/calibre/ebooks/oeb/transforms/split.py @@ -20,7 +20,7 @@ from calibre.ebooks.epub import rules from calibre.ebooks.oeb.base import (OEB_STYLES, XPNSMAP as NAMESPACES, urldefrag, rewrite_links, XHTML, urlnormalize) from calibre.ebooks.oeb.polish.split import do_split -from polyglot.builtins import iteritems, range, map, unicode_type +from polyglot.builtins import iteritems, unicode_type from polyglot.urllib import unquote from css_selectors import Select, SelectorError diff --git a/src/calibre/ebooks/oeb/transforms/subset.py b/src/calibre/ebooks/oeb/transforms/subset.py index 21b3a93185..392264eae5 100644 --- a/src/calibre/ebooks/oeb/transforms/subset.py +++ b/src/calibre/ebooks/oeb/transforms/subset.py @@ -10,7 +10,7 @@ from collections import defaultdict from calibre.ebooks.oeb.base import urlnormalize, css_text from calibre.utils.fonts.sfnt.subset import subset, NoGlyphs, UnsupportedFont -from polyglot.builtins import iteritems, itervalues, unicode_type, range +from polyglot.builtins import iteritems, itervalues, unicode_type from tinycss.fonts3 import parse_font_family diff --git a/src/calibre/ebooks/pdb/ereader/reader132.py b/src/calibre/ebooks/pdb/ereader/reader132.py index 2bcab72d86..820c8e6734 100644 --- a/src/calibre/ebooks/pdb/ereader/reader132.py +++ b/src/calibre/ebooks/pdb/ereader/reader132.py @@ -19,7 +19,7 @@ from calibre.ebooks import DRMError from calibre.ebooks.metadata.opf2 import OPFCreator from calibre.ebooks.pdb.ereader import EreaderError from calibre.ebooks.pdb.formatreader import FormatReader -from polyglot.builtins import unicode_type, range +from polyglot.builtins import unicode_type class HeaderRecord: diff --git a/src/calibre/ebooks/pdb/ereader/reader202.py b/src/calibre/ebooks/pdb/ereader/reader202.py index 444137cba8..f328381787 100644 --- a/src/calibre/ebooks/pdb/ereader/reader202.py +++ b/src/calibre/ebooks/pdb/ereader/reader202.py @@ -15,7 +15,7 @@ from calibre import CurrentDir from calibre.ebooks.metadata.opf2 import OPFCreator from calibre.ebooks.pdb.ereader import EreaderError from calibre.ebooks.pdb.formatreader import FormatReader -from polyglot.builtins import as_unicode, range, unicode_type +from polyglot.builtins import as_unicode, unicode_type class HeaderRecord: diff --git a/src/calibre/ebooks/pdb/haodoo/reader.py b/src/calibre/ebooks/pdb/haodoo/reader.py index 6118ee8dc8..7c3ea18e65 100644 --- a/src/calibre/ebooks/pdb/haodoo/reader.py +++ b/src/calibre/ebooks/pdb/haodoo/reader.py @@ -17,7 +17,6 @@ from calibre import prepare_string_for_xml from calibre.ebooks.pdb.formatreader import FormatReader from calibre.ebooks.metadata import MetaInformation from calibre.ebooks.txt.processor import opf_writer, HTML_TEMPLATE -from polyglot.builtins import range, map BPDB_IDENT = 'BOOKMTIT' UPDB_IDENT = 'BOOKMTIU' diff --git a/src/calibre/ebooks/pdb/pdf/reader.py b/src/calibre/ebooks/pdb/pdf/reader.py index f683621e25..5b6a022035 100644 --- a/src/calibre/ebooks/pdb/pdf/reader.py +++ b/src/calibre/ebooks/pdb/pdf/reader.py @@ -12,7 +12,6 @@ __docformat__ = 'restructuredtext en' from calibre.ebooks.pdb.formatreader import FormatReader from calibre.ptempfile import PersistentTemporaryFile -from polyglot.builtins import range class Reader(FormatReader): diff --git a/src/calibre/ebooks/pdb/plucker/reader.py b/src/calibre/ebooks/pdb/plucker/reader.py index 0c090dd172..d8716913b6 100644 --- a/src/calibre/ebooks/pdb/plucker/reader.py +++ b/src/calibre/ebooks/pdb/plucker/reader.py @@ -16,7 +16,7 @@ from calibre.ebooks.pdb.formatreader import FormatReader from calibre.ebooks.compression.palmdoc import decompress_doc from calibre.utils.imghdr import identify from calibre.utils.img import save_cover_data_to, Canvas, image_from_data -from polyglot.builtins import codepoint_to_chr, range +from polyglot.builtins import codepoint_to_chr DATATYPE_PHTML = 0 DATATYPE_PHTML_COMPRESSED = 1 diff --git a/src/calibre/ebooks/pdf/html_writer.py b/src/calibre/ebooks/pdf/html_writer.py index 43c4bcda4c..d261e51a7a 100644 --- a/src/calibre/ebooks/pdf/html_writer.py +++ b/src/calibre/ebooks/pdf/html_writer.py @@ -44,7 +44,7 @@ from calibre.utils.podofo import ( dedup_type3_fonts, get_podofo, remove_unused_fonts, set_metadata_implementation ) from calibre.utils.short_uuid import uuid4 -from polyglot.builtins import filter, iteritems, map, range, unicode_type +from polyglot.builtins import iteritems, unicode_type from polyglot.urllib import urlparse OK, KILL_SIGNAL = range(0, 2) diff --git a/src/calibre/ebooks/pdf/reflow.py b/src/calibre/ebooks/pdf/reflow.py index b8faef4aa5..37ffee3f55 100644 --- a/src/calibre/ebooks/pdf/reflow.py +++ b/src/calibre/ebooks/pdf/reflow.py @@ -11,7 +11,6 @@ from itertools import count from lxml import etree -from polyglot.builtins import range, map from calibre.utils.xml_parse import safe_xml_fromstring diff --git a/src/calibre/ebooks/pdf/render/fonts.py b/src/calibre/ebooks/pdf/render/fonts.py index 2522345a4c..0727a0a1a0 100644 --- a/src/calibre/ebooks/pdf/render/fonts.py +++ b/src/calibre/ebooks/pdf/render/fonts.py @@ -10,7 +10,7 @@ import re from itertools import groupby from operator import itemgetter from collections import Counter, OrderedDict -from polyglot.builtins import iteritems, map, zip, unicode_type, codepoint_to_chr +from polyglot.builtins import iteritems, unicode_type, codepoint_to_chr from calibre import as_unicode from calibre.ebooks.pdf.render.common import (Array, String, Stream, diff --git a/src/calibre/ebooks/pdf/render/gradients.py b/src/calibre/ebooks/pdf/render/gradients.py index f39feedfdf..f2d6d88440 100644 --- a/src/calibre/ebooks/pdf/render/gradients.py +++ b/src/calibre/ebooks/pdf/render/gradients.py @@ -7,7 +7,6 @@ __copyright__ = '2013, Kovid Goyal ' __docformat__ = 'restructuredtext en' import sys, copy -from polyglot.builtins import map, range from collections import namedtuple from qt.core import QLinearGradient, QPointF, sip diff --git a/src/calibre/ebooks/pdf/render/serialize.py b/src/calibre/ebooks/pdf/render/serialize.py index 5df4fb1592..dc73fe8cca 100644 --- a/src/calibre/ebooks/pdf/render/serialize.py +++ b/src/calibre/ebooks/pdf/render/serialize.py @@ -7,7 +7,7 @@ __copyright__ = '2012, Kovid Goyal ' __docformat__ = 'restructuredtext en' import hashlib, numbers -from polyglot.builtins import map, iteritems +from polyglot.builtins import iteritems from qt.core import QBuffer, QByteArray, QImage, Qt, QColor, qRgba, QPainter diff --git a/src/calibre/ebooks/pml/__init__.py b/src/calibre/ebooks/pml/__init__.py index e4091d8e48..92cef986da 100644 --- a/src/calibre/ebooks/pml/__init__.py +++ b/src/calibre/ebooks/pml/__init__.py @@ -5,7 +5,6 @@ __license__ = 'GPL v3' __copyright__ = '2009, John Schember ' __docformat__ = 'restructuredtext en' -from polyglot.builtins import range def r(*a): diff --git a/src/calibre/ebooks/rb/reader.py b/src/calibre/ebooks/rb/reader.py index 088308b83a..cda2f3898e 100644 --- a/src/calibre/ebooks/rb/reader.py +++ b/src/calibre/ebooks/rb/reader.py @@ -14,7 +14,7 @@ from calibre.ebooks.rb import HEADER from calibre.ebooks.rb import RocketBookError from calibre.ebooks.metadata.rb import get_metadata from calibre.ebooks.metadata.opf2 import OPFCreator -from polyglot.builtins import range, as_unicode +from polyglot.builtins import as_unicode from polyglot.urllib import unquote diff --git a/src/calibre/ebooks/rtf2xml/tokenize.py b/src/calibre/ebooks/rtf2xml/tokenize.py index 752a3ec82d..95d3e90b1b 100644 --- a/src/calibre/ebooks/rtf2xml/tokenize.py +++ b/src/calibre/ebooks/rtf2xml/tokenize.py @@ -16,7 +16,7 @@ import os, re from calibre.ebooks.rtf2xml import copy from calibre.utils.mreplace import MReplace from calibre.ptempfile import better_mktemp -from polyglot.builtins import codepoint_to_chr, range, filter, map +from polyglot.builtins import codepoint_to_chr from . import open_for_read, open_for_write diff --git a/src/calibre/ebooks/txt/processor.py b/src/calibre/ebooks/txt/processor.py index fe46e39b1d..e05adfbd79 100644 --- a/src/calibre/ebooks/txt/processor.py +++ b/src/calibre/ebooks/txt/processor.py @@ -17,7 +17,7 @@ from calibre.ebooks.metadata.opf2 import OPFCreator from calibre.ebooks.conversion.preprocess import DocAnalysis from calibre.utils.cleantext import clean_ascii_chars -from polyglot.builtins import iteritems, unicode_type, map, range +from polyglot.builtins import iteritems, unicode_type HTML_TEMPLATE = '%s \n%s\n' diff --git a/src/calibre/ebooks/unihandecode/pykakasi/h2a.py b/src/calibre/ebooks/unihandecode/pykakasi/h2a.py index ff76aa2e56..4a76457af0 100644 --- a/src/calibre/ebooks/unihandecode/pykakasi/h2a.py +++ b/src/calibre/ebooks/unihandecode/pykakasi/h2a.py @@ -22,9 +22,6 @@ # */ -from polyglot.builtins import range - - class H2a : H2a_table = { diff --git a/src/calibre/ebooks/unihandecode/pykakasi/k2a.py b/src/calibre/ebooks/unihandecode/pykakasi/k2a.py index 02ce52ada9..117ef64b54 100644 --- a/src/calibre/ebooks/unihandecode/pykakasi/k2a.py +++ b/src/calibre/ebooks/unihandecode/pykakasi/k2a.py @@ -23,7 +23,6 @@ from calibre.ebooks.unihandecode.pykakasi.jisyo import jisyo -from polyglot.builtins import range class K2a : diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index 23742b5733..935af43d64 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -38,9 +38,7 @@ from calibre.utils.date import UNDEFINED_DATE from calibre.utils.file_type_icons import EXT_MAP from calibre.utils.localization import get_lang from polyglot import queue -from polyglot.builtins import ( - iteritems, itervalues, range, string_or_bytes, unicode_type, map -) +from polyglot.builtins import iteritems, itervalues, string_or_bytes, unicode_type try: NO_URL_FORMATTING = QUrl.UrlFormattingOption.None_ diff --git a/src/calibre/gui2/actions/add.py b/src/calibre/gui2/actions/add.py index cfe65c8c2a..661f053ba8 100644 --- a/src/calibre/gui2/actions/add.py +++ b/src/calibre/gui2/actions/add.py @@ -27,7 +27,7 @@ from calibre.ptempfile import PersistentTemporaryFile from calibre.utils.config_base import tweaks from calibre.utils.filenames import ascii_filename, make_long_path_useable from calibre.utils.icu import sort_key -from polyglot.builtins import iteritems, range, string_or_bytes +from polyglot.builtins import iteritems, string_or_bytes def get_filters(): diff --git a/src/calibre/gui2/actions/annotate.py b/src/calibre/gui2/actions/annotate.py index a618e3b63b..6e258b00e5 100644 --- a/src/calibre/gui2/actions/annotate.py +++ b/src/calibre/gui2/actions/annotate.py @@ -13,7 +13,7 @@ from calibre.gui2 import error_dialog from calibre.gui2.actions import InterfaceAction from calibre.devices.usbms.device import Device from calibre.gui2.dialogs.progress import ProgressDialog -from polyglot.builtins import iteritems, range, map +from polyglot.builtins import iteritems class Updater(QThread): # {{{ diff --git a/src/calibre/gui2/actions/author_mapper.py b/src/calibre/gui2/actions/author_mapper.py index 3616901b3b..4f1f4ae99f 100644 --- a/src/calibre/gui2/actions/author_mapper.py +++ b/src/calibre/gui2/actions/author_mapper.py @@ -6,7 +6,7 @@ from qt.core import QDialog from calibre.gui2 import gprefs from calibre.gui2.actions import InterfaceAction -from polyglot.builtins import iteritems, map, range +from polyglot.builtins import iteritems class AuthorMapAction(InterfaceAction): diff --git a/src/calibre/gui2/actions/catalog.py b/src/calibre/gui2/actions/catalog.py index cdb998954d..8d3591a0e6 100644 --- a/src/calibre/gui2/actions/catalog.py +++ b/src/calibre/gui2/actions/catalog.py @@ -15,7 +15,6 @@ from calibre.gui2.tools import generate_catalog from calibre.utils.config import dynamic from calibre.gui2.actions import InterfaceAction from calibre import sanitize_file_name -from polyglot.builtins import range, map class GenerateCatalogAction(InterfaceAction): diff --git a/src/calibre/gui2/actions/choose_library.py b/src/calibre/gui2/actions/choose_library.py index 7cb3ec20ac..b1d191936a 100644 --- a/src/calibre/gui2/actions/choose_library.py +++ b/src/calibre/gui2/actions/choose_library.py @@ -20,7 +20,7 @@ from calibre.utils.icu import sort_key from calibre.gui2 import (gprefs, warning_dialog, Dispatcher, error_dialog, question_dialog, info_dialog, open_local_file, choose_dir) from calibre.gui2.actions import InterfaceAction -from polyglot.builtins import unicode_type, range +from polyglot.builtins import unicode_type def db_class(): diff --git a/src/calibre/gui2/actions/edit_metadata.py b/src/calibre/gui2/actions/edit_metadata.py index b37a1bfac3..ba0dd5c0d2 100644 --- a/src/calibre/gui2/actions/edit_metadata.py +++ b/src/calibre/gui2/actions/edit_metadata.py @@ -30,7 +30,7 @@ from calibre.library.comments import merge_comments from calibre.utils.config import tweaks from calibre.utils.date import is_date_undefined from calibre.utils.icu import sort_key -from polyglot.builtins import iteritems, map, unicode_type +from polyglot.builtins import iteritems, unicode_type class EditMetadataAction(InterfaceAction): diff --git a/src/calibre/gui2/actions/polish.py b/src/calibre/gui2/actions/polish.py index 15f66cf543..7f47e11397 100644 --- a/src/calibre/gui2/actions/polish.py +++ b/src/calibre/gui2/actions/polish.py @@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en' import os, weakref, shutil, textwrap from collections import OrderedDict from functools import partial -from polyglot.builtins import iteritems, itervalues, map, unicode_type +from polyglot.builtins import iteritems, itervalues, unicode_type from qt.core import (QDialog, QGridLayout, QIcon, QCheckBox, QLabel, QFrame, QApplication, QDialogButtonBox, Qt, QSize, QSpacerItem, diff --git a/src/calibre/gui2/actions/save_to_disk.py b/src/calibre/gui2/actions/save_to_disk.py index 780fbe7314..fc28a97d8b 100644 --- a/src/calibre/gui2/actions/save_to_disk.py +++ b/src/calibre/gui2/actions/save_to_disk.py @@ -12,7 +12,7 @@ from functools import partial from calibre.utils.config import prefs from calibre.gui2 import error_dialog, Dispatcher, choose_dir from calibre.gui2.actions import InterfaceAction -from polyglot.builtins import itervalues, map +from polyglot.builtins import itervalues class SaveToDiskAction(InterfaceAction): diff --git a/src/calibre/gui2/actions/tag_mapper.py b/src/calibre/gui2/actions/tag_mapper.py index dfb8e9c0b8..e684b86f33 100644 --- a/src/calibre/gui2/actions/tag_mapper.py +++ b/src/calibre/gui2/actions/tag_mapper.py @@ -4,7 +4,7 @@ from qt.core import QDialog -from polyglot.builtins import iteritems, map, range +from polyglot.builtins import iteritems from calibre.gui2 import gprefs from calibre.gui2.actions import InterfaceAction diff --git a/src/calibre/gui2/add.py b/src/calibre/gui2/add.py index bad02f007e..818c5b0d5e 100644 --- a/src/calibre/gui2/add.py +++ b/src/calibre/gui2/add.py @@ -33,7 +33,7 @@ from calibre.utils import join_with_timeout from calibre.utils.config import prefs from calibre.utils.filenames import make_long_path_useable from calibre.utils.ipc.pool import Failure, Pool -from polyglot.builtins import iteritems, map, string_or_bytes, unicode_type +from polyglot.builtins import iteritems, string_or_bytes, unicode_type from polyglot.queue import Empty diff --git a/src/calibre/gui2/add_filters.py b/src/calibre/gui2/add_filters.py index b00fe84d0f..e51091ee4e 100644 --- a/src/calibre/gui2/add_filters.py +++ b/src/calibre/gui2/add_filters.py @@ -4,7 +4,7 @@ from collections import OrderedDict -from polyglot.builtins import map, unicode_type +from polyglot.builtins import unicode_type from calibre.db.adding import compile_glob, filter_filename, compile_rule from calibre.gui2 import elided_text, Application, error_dialog diff --git a/src/calibre/gui2/auto_add.py b/src/calibre/gui2/auto_add.py index fbaf3a10ff..e19b703f3e 100644 --- a/src/calibre/gui2/auto_add.py +++ b/src/calibre/gui2/auto_add.py @@ -17,7 +17,6 @@ from calibre.ebooks import BOOK_EXTENSIONS from calibre.gui2 import gprefs from calibre.gui2.dialogs.duplicates import DuplicatesQuestion from calibre.utils.tdir_in_cache import tdir_in_cache -from polyglot.builtins import map AUTO_ADDED = frozenset(BOOK_EXTENSIONS) - {'pdr', 'mbp', 'tan'} diff --git a/src/calibre/gui2/bars.py b/src/calibre/gui2/bars.py index 6a0ff0acdb..16b1039d3e 100644 --- a/src/calibre/gui2/bars.py +++ b/src/calibre/gui2/bars.py @@ -14,7 +14,7 @@ from qt.core import ( from calibre.constants import ismacos from calibre.gui2 import gprefs, native_menubar_defaults, config from calibre.gui2.throbber import ThrobbingButton -from polyglot.builtins import itervalues, unicode_type, map, range +from polyglot.builtins import itervalues, unicode_type class RevealBar(QWidget): # {{{ diff --git a/src/calibre/gui2/catalog/catalog_bibtex.py b/src/calibre/gui2/catalog/catalog_bibtex.py index 3f4072999b..4583091e66 100644 --- a/src/calibre/gui2/catalog/catalog_bibtex.py +++ b/src/calibre/gui2/catalog/catalog_bibtex.py @@ -11,7 +11,7 @@ from qt.core import QWidget, QListWidgetItem from calibre.gui2 import gprefs from calibre.gui2.catalog.catalog_bibtex_ui import Ui_Form -from polyglot.builtins import unicode_type, range +from polyglot.builtins import unicode_type class PluginWidget(QWidget, Ui_Form): diff --git a/src/calibre/gui2/catalog/catalog_csv_xml.py b/src/calibre/gui2/catalog/catalog_csv_xml.py index 9242287143..1838e526dd 100644 --- a/src/calibre/gui2/catalog/catalog_csv_xml.py +++ b/src/calibre/gui2/catalog/catalog_csv_xml.py @@ -11,7 +11,7 @@ from qt.core import QWidget, QListWidgetItem, Qt, QVBoxLayout, QLabel, QListWidg from calibre.constants import ismacos from calibre.gui2 import gprefs from calibre.gui2.ui import get_gui -from polyglot.builtins import unicode_type, range +from polyglot.builtins import unicode_type def get_saved_field_data(name, all_fields): diff --git a/src/calibre/gui2/catalog/catalog_epub_mobi.py b/src/calibre/gui2/catalog/catalog_epub_mobi.py index 813beada14..ad99cee609 100644 --- a/src/calibre/gui2/catalog/catalog_epub_mobi.py +++ b/src/calibre/gui2/catalog/catalog_epub_mobi.py @@ -15,7 +15,7 @@ from calibre.gui2 import gprefs, open_url, question_dialog, error_dialog from calibre.utils.config import JSONConfig from calibre.utils.icu import sort_key from calibre.utils.localization import localize_user_manual_link -from polyglot.builtins import native_string_type, unicode_type, zip, range +from polyglot.builtins import native_string_type, unicode_type from .catalog_epub_mobi_ui import Ui_Form from qt.core import (Qt, QAbstractItemView, QCheckBox, QComboBox, diff --git a/src/calibre/gui2/comments_editor.py b/src/calibre/gui2/comments_editor.py index 01259a1f0e..c7d9a14a4b 100644 --- a/src/calibre/gui2/comments_editor.py +++ b/src/calibre/gui2/comments_editor.py @@ -31,7 +31,7 @@ from calibre.gui2.widgets2 import to_plain_text from calibre.utils.cleantext import clean_xml_chars from calibre.utils.config import tweaks from calibre.utils.imghdr import what -from polyglot.builtins import filter, iteritems, itervalues, unicode_type +from polyglot.builtins import iteritems, itervalues, unicode_type # Cleanup Qt markup {{{ diff --git a/src/calibre/gui2/convert/heuristics.py b/src/calibre/gui2/convert/heuristics.py index 93186b2e73..c74310ebe9 100644 --- a/src/calibre/gui2/convert/heuristics.py +++ b/src/calibre/gui2/convert/heuristics.py @@ -12,7 +12,7 @@ from calibre.gui2.convert.heuristics_ui import Ui_Form from calibre.gui2.convert import Widget from calibre.utils.localization import localize_user_manual_link from calibre.ebooks.conversion.config import OPTIONS -from polyglot.builtins import unicode_type, range +from polyglot.builtins import unicode_type class HeuristicsWidget(Widget, Ui_Form): diff --git a/src/calibre/gui2/convert/regex_builder.py b/src/calibre/gui2/convert/regex_builder.py index 5a692e508f..a8590c4e88 100644 --- a/src/calibre/gui2/convert/regex_builder.py +++ b/src/calibre/gui2/convert/regex_builder.py @@ -18,7 +18,7 @@ from calibre.gui2.dialogs.choose_format import ChooseFormatDialog from calibre.ptempfile import TemporaryFile from calibre.utils.icu import utf16_length from calibre.utils.ipc.simple_worker import WorkerError, fork_job -from polyglot.builtins import native_string_type, range, unicode_type +from polyglot.builtins import native_string_type, unicode_type class RegexBuilder(QDialog, Ui_RegexBuilder): diff --git a/src/calibre/gui2/convert/search_and_replace.py b/src/calibre/gui2/convert/search_and_replace.py index cb0a32e5de..d2c25ad736 100644 --- a/src/calibre/gui2/convert/search_and_replace.py +++ b/src/calibre/gui2/convert/search_and_replace.py @@ -17,7 +17,7 @@ from calibre import as_unicode from calibre.utils.localization import localize_user_manual_link from calibre.ebooks.conversion.search_replace import compile_regular_expression from calibre.ebooks.conversion.config import OPTIONS -from polyglot.builtins import unicode_type, range +from polyglot.builtins import unicode_type class SearchAndReplaceWidget(Widget, Ui_Form): diff --git a/src/calibre/gui2/convert/xpath_wizard.py b/src/calibre/gui2/convert/xpath_wizard.py index 95bfb403b4..9870e12625 100644 --- a/src/calibre/gui2/convert/xpath_wizard.py +++ b/src/calibre/gui2/convert/xpath_wizard.py @@ -11,7 +11,7 @@ from qt.core import QDialog, QWidget, Qt, QDialogButtonBox, QVBoxLayout from calibre.gui2.convert.xpath_wizard_ui import Ui_Form from calibre.gui2.convert.xexp_edit_ui import Ui_Form as Ui_Edit from calibre.utils.localization import localize_user_manual_link -from polyglot.builtins import unicode_type, map +from polyglot.builtins import unicode_type class WizardWidget(QWidget, Ui_Form): diff --git a/src/calibre/gui2/device_drivers/mtp_config.py b/src/calibre/gui2/device_drivers/mtp_config.py index 9a0fc04f8a..953d8fb021 100644 --- a/src/calibre/gui2/device_drivers/mtp_config.py +++ b/src/calibre/gui2/device_drivers/mtp_config.py @@ -19,7 +19,7 @@ from calibre.gui2 import error_dialog from calibre.gui2.dialogs.template_dialog import TemplateDialog from calibre.utils.date import parse_date from calibre.gui2.device_drivers.mtp_folder_browser import Browser, IgnoredFolders -from polyglot.builtins import iteritems, unicode_type, range +from polyglot.builtins import iteritems, unicode_type class FormatsConfig(QWidget): # {{{ diff --git a/src/calibre/gui2/device_drivers/mtp_folder_browser.py b/src/calibre/gui2/device_drivers/mtp_folder_browser.py index 9a92437b18..f712bc079c 100644 --- a/src/calibre/gui2/device_drivers/mtp_folder_browser.py +++ b/src/calibre/gui2/device_drivers/mtp_folder_browser.py @@ -12,7 +12,7 @@ from qt.core import (QTabWidget, QTreeWidget, QTreeWidgetItem, Qt, QDialog, QDialogButtonBox, QVBoxLayout, QSize, pyqtSignal, QIcon, QLabel) from calibre.gui2 import file_icon_provider -from polyglot.builtins import unicode_type, range +from polyglot.builtins import unicode_type def browser_item(f, parent): diff --git a/src/calibre/gui2/device_drivers/tabbed_device_config.py b/src/calibre/gui2/device_drivers/tabbed_device_config.py index 106543faeb..2ccdb64ff5 100644 --- a/src/calibre/gui2/device_drivers/tabbed_device_config.py +++ b/src/calibre/gui2/device_drivers/tabbed_device_config.py @@ -15,7 +15,7 @@ from qt.core import ( from calibre.ebooks import BOOK_EXTENSIONS from calibre.gui2.device_drivers.mtp_config import (FormatsConfig, TemplateConfig) from calibre.devices.usbms.driver import debug_print -from polyglot.builtins import unicode_type, range +from polyglot.builtins import unicode_type def wrap_msg(msg): diff --git a/src/calibre/gui2/dialogs/add_from_isbn.py b/src/calibre/gui2/dialogs/add_from_isbn.py index 349c1a2561..8942178e53 100644 --- a/src/calibre/gui2/dialogs/add_from_isbn.py +++ b/src/calibre/gui2/dialogs/add_from_isbn.py @@ -15,7 +15,7 @@ from qt.core import ( from calibre.constants import iswindows from calibre.ebooks.metadata import check_isbn from calibre.gui2 import error_dialog, gprefs, question_dialog -from polyglot.builtins import filter, unicode_type +from polyglot.builtins import unicode_type class AddFromISBN(QDialog): diff --git a/src/calibre/gui2/dialogs/authors_edit.py b/src/calibre/gui2/dialogs/authors_edit.py index c5930023f0..3394341530 100644 --- a/src/calibre/gui2/dialogs/authors_edit.py +++ b/src/calibre/gui2/dialogs/authors_edit.py @@ -15,7 +15,7 @@ from calibre.utils.config_base import tweaks from calibre.gui2 import gprefs from calibre.gui2.complete2 import EditWithComplete from calibre.ebooks.metadata import string_to_authors -from polyglot.builtins import unicode_type, range +from polyglot.builtins import unicode_type class ItemDelegate(QStyledItemDelegate): diff --git a/src/calibre/gui2/dialogs/custom_recipes.py b/src/calibre/gui2/dialogs/custom_recipes.py index 597ea8843c..4ff7fd1c1c 100644 --- a/src/calibre/gui2/dialogs/custom_recipes.py +++ b/src/calibre/gui2/dialogs/custom_recipes.py @@ -20,7 +20,7 @@ from calibre.web.feeds.recipes import custom_recipes, compile_recipe from calibre.gui2.tweak_book.editor.text import TextEdit from calibre.web.feeds.recipes.collection import get_builtin_recipe_by_id from calibre.utils.localization import localize_user_manual_link -from polyglot.builtins import iteritems, unicode_type, range, as_unicode +from polyglot.builtins import iteritems, unicode_type, as_unicode from calibre.gui2.search_box import SearchBox2 from polyglot.builtins import as_bytes diff --git a/src/calibre/gui2/dialogs/duplicates.py b/src/calibre/gui2/dialogs/duplicates.py index e21bb6fb7c..45f48319f0 100644 --- a/src/calibre/gui2/dialogs/duplicates.py +++ b/src/calibre/gui2/dialogs/duplicates.py @@ -15,7 +15,7 @@ from qt.core import ( from calibre.gui2 import gprefs from calibre.ebooks.metadata import authors_to_string from calibre.utils.icu import primary_sort_key -from polyglot.builtins import unicode_type, range +from polyglot.builtins import unicode_type class DuplicatesQuestion(QDialog): diff --git a/src/calibre/gui2/dialogs/exim.py b/src/calibre/gui2/dialogs/exim.py index 1e4d6356e2..a15edf54b6 100644 --- a/src/calibre/gui2/dialogs/exim.py +++ b/src/calibre/gui2/dialogs/exim.py @@ -20,7 +20,6 @@ from calibre.gui2 import choose_dir, error_dialog, question_dialog from calibre.gui2.widgets2 import Dialog from calibre.utils.exim import all_known_libraries, export, Importer, import_data from calibre.utils.icu import numeric_sort_key -from polyglot.builtins import range def disk_usage(path_to_dir, abort=None): diff --git a/src/calibre/gui2/dialogs/metadata_bulk.py b/src/calibre/gui2/dialogs/metadata_bulk.py index 0a053774f2..a5df896a98 100644 --- a/src/calibre/gui2/dialogs/metadata_bulk.py +++ b/src/calibre/gui2/dialogs/metadata_bulk.py @@ -33,9 +33,7 @@ from calibre.utils.config import JSONConfig, dynamic, prefs, tweaks from calibre.utils.date import internal_iso_format_string, qt_to_dt from calibre.utils.icu import capitalize, sort_key from calibre.utils.titlecase import titlecase -from polyglot.builtins import ( - error_message, filter, iteritems, itervalues, native_string_type, unicode_type -) +from polyglot.builtins import error_message, iteritems, itervalues, native_string_type, unicode_type Settings = namedtuple('Settings', 'remove_all remove add au aus do_aus rating pub do_series do_autonumber ' diff --git a/src/calibre/gui2/dialogs/plugin_updater.py b/src/calibre/gui2/dialogs/plugin_updater.py index 95175298b0..09369b45c2 100644 --- a/src/calibre/gui2/dialogs/plugin_updater.py +++ b/src/calibre/gui2/dialogs/plugin_updater.py @@ -29,7 +29,7 @@ from calibre.gui2 import error_dialog, gprefs, info_dialog, open_url, question_d from calibre.gui2.preferences.plugins import ConfigWidget from calibre.utils.date import UNDEFINED_DATE, format_date from calibre.utils.https import get_https_resource_securely -from polyglot.builtins import filter, itervalues, map, unicode_type +from polyglot.builtins import itervalues, unicode_type SERVER = 'https://code.calibre-ebook.com/plugins/' INDEX_URL = '%splugins.json.bz2' % SERVER diff --git a/src/calibre/gui2/dialogs/scheduler.py b/src/calibre/gui2/dialogs/scheduler.py index ba7c274cba..be6c1fbed9 100644 --- a/src/calibre/gui2/dialogs/scheduler.py +++ b/src/calibre/gui2/dialogs/scheduler.py @@ -27,7 +27,7 @@ from calibre.utils.date import utcnow from calibre.utils.network import internet_connected from calibre import force_unicode from calibre.utils.localization import get_lang, canonicalize_lang -from polyglot.builtins import iteritems, unicode_type, range, map +from polyglot.builtins import iteritems, unicode_type def convert_day_time_schedule(val): diff --git a/src/calibre/gui2/dialogs/search.py b/src/calibre/gui2/dialogs/search.py index d02f14dede..15b26d5f91 100644 --- a/src/calibre/gui2/dialogs/search.py +++ b/src/calibre/gui2/dialogs/search.py @@ -20,7 +20,7 @@ from calibre.utils.icu import sort_key from calibre.utils.config import tweaks from calibre.utils.date import now from calibre.utils.localization import localize_user_manual_link -from polyglot.builtins import unicode_type, range, map +from polyglot.builtins import unicode_type box_values = {} last_matchkind = CONTAINS_MATCH diff --git a/src/calibre/gui2/dialogs/smartdevice.py b/src/calibre/gui2/dialogs/smartdevice.py index 6dc518f055..8b7cdc4aa7 100644 --- a/src/calibre/gui2/dialogs/smartdevice.py +++ b/src/calibre/gui2/dialogs/smartdevice.py @@ -9,7 +9,7 @@ from qt.core import (QDialog, QLineEdit, Qt) from calibre.gui2 import error_dialog from calibre.gui2.dialogs.smartdevice_ui import Ui_Dialog from calibre.utils.mdns import get_all_ips -from polyglot.builtins import itervalues, unicode_type, map +from polyglot.builtins import itervalues, unicode_type def ipaddr_sort_key(ipaddr): diff --git a/src/calibre/gui2/dialogs/tag_editor.py b/src/calibre/gui2/dialogs/tag_editor.py index e36df92a74..75f2837424 100644 --- a/src/calibre/gui2/dialogs/tag_editor.py +++ b/src/calibre/gui2/dialogs/tag_editor.py @@ -10,7 +10,7 @@ from calibre.gui2.dialogs.tag_editor_ui import Ui_TagEditor from calibre.gui2 import question_dialog, error_dialog, gprefs from calibre.constants import islinux from calibre.utils.icu import sort_key, primary_contains -from polyglot.builtins import unicode_type, range +from polyglot.builtins import unicode_type class TagEditor(QDialog, Ui_TagEditor): diff --git a/src/calibre/gui2/font_family_chooser.py b/src/calibre/gui2/font_family_chooser.py index 9b2b00fdf1..8226f503a4 100644 --- a/src/calibre/gui2/font_family_chooser.py +++ b/src/calibre/gui2/font_family_chooser.py @@ -16,7 +16,7 @@ from qt.core import (QFontInfo, QFontMetrics, Qt, QFont, QFontDatabase, QPen, from calibre.constants import config_dir from calibre.gui2 import choose_files, error_dialog, info_dialog, empty_index -from polyglot.builtins import unicode_type, range +from polyglot.builtins import unicode_type def add_fonts(parent): diff --git a/src/calibre/gui2/icon_theme.py b/src/calibre/gui2/icon_theme.py index 1d2a9ed299..20d3643548 100644 --- a/src/calibre/gui2/icon_theme.py +++ b/src/calibre/gui2/icon_theme.py @@ -33,7 +33,7 @@ from calibre.utils.icu import numeric_sort_key as sort_key from calibre.utils.img import image_from_data, Canvas, optimize_png, optimize_jpeg from calibre.utils.zipfile import ZipFile, ZIP_STORED from calibre.utils.filenames import atomic_rename -from polyglot.builtins import iteritems, map, range, reraise, filter, as_bytes, unicode_type +from polyglot.builtins import iteritems, reraise, as_bytes, unicode_type from polyglot import http_client from polyglot.queue import Queue, Empty diff --git a/src/calibre/gui2/job_indicator.py b/src/calibre/gui2/job_indicator.py index 6152b36d9a..c311125802 100644 --- a/src/calibre/gui2/job_indicator.py +++ b/src/calibre/gui2/job_indicator.py @@ -12,7 +12,6 @@ from qt.core import ( ) from calibre.gui2 import config -from polyglot.builtins import range class Pointer(QWidget): diff --git a/src/calibre/gui2/jobs.py b/src/calibre/gui2/jobs.py index c9f4766888..bcf8a1c093 100644 --- a/src/calibre/gui2/jobs.py +++ b/src/calibre/gui2/jobs.py @@ -31,7 +31,6 @@ from calibre.gui2.threaded_jobs import ThreadedJobServer, ThreadedJob from calibre.gui2.widgets2 import Dialog from calibre.utils.search_query_parser import SearchQueryParser, ParseException from calibre.utils.icu import lower -from polyglot.builtins import range from polyglot.queue import Empty, Queue diff --git a/src/calibre/gui2/keyboard.py b/src/calibre/gui2/keyboard.py index 34b6913b9a..17f4fdd21e 100644 --- a/src/calibre/gui2/keyboard.py +++ b/src/calibre/gui2/keyboard.py @@ -21,7 +21,7 @@ from calibre.utils.icu import sort_key, lower from calibre.gui2 import error_dialog, info_dialog from calibre.utils.search_query_parser import SearchQueryParser, ParseException from calibre.gui2.search_box import SearchBox2 -from polyglot.builtins import iteritems, itervalues, unicode_type, range +from polyglot.builtins import iteritems, itervalues, unicode_type ROOT = QModelIndex() diff --git a/src/calibre/gui2/library/alternate_views.py b/src/calibre/gui2/library/alternate_views.py index 757fd92e61..4c7849d150 100644 --- a/src/calibre/gui2/library/alternate_views.py +++ b/src/calibre/gui2/library/alternate_views.py @@ -31,7 +31,7 @@ from calibre.gui2.library.caches import CoverCache, ThumbnailCache from calibre.gui2.pin_columns import PinContainer from calibre.utils import join_with_timeout from calibre.utils.config import prefs, tweaks -from polyglot.builtins import itervalues, range, unicode_type +from polyglot.builtins import itervalues, unicode_type from polyglot.queue import LifoQueue CM_TO_INCH = 0.393701 diff --git a/src/calibre/gui2/library/models.py b/src/calibre/gui2/library/models.py index 92d07c7921..854aed3d2b 100644 --- a/src/calibre/gui2/library/models.py +++ b/src/calibre/gui2/library/models.py @@ -41,9 +41,7 @@ from calibre.utils.date import ( from calibre.utils.icu import sort_key from calibre.utils.localization import calibre_langcode_to_name from calibre.utils.search_query_parser import ParseException, SearchQueryParser -from polyglot.builtins import ( - iteritems, itervalues, map, range, string_or_bytes, unicode_type -) +from polyglot.builtins import iteritems, itervalues, string_or_bytes, unicode_type Counts = namedtuple('Counts', 'library_total total current') diff --git a/src/calibre/gui2/library/views.py b/src/calibre/gui2/library/views.py index 84af133d67..6333b8f1aa 100644 --- a/src/calibre/gui2/library/views.py +++ b/src/calibre/gui2/library/views.py @@ -30,7 +30,7 @@ from calibre.gui2.library import DEFAULT_SORT from calibre.constants import filesystem_encoding from calibre import force_unicode from calibre.utils.icu import primary_sort_key -from polyglot.builtins import iteritems, map, range, unicode_type +from polyglot.builtins import iteritems, unicode_type def restrict_column_width(self, col, old_size, new_size): diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index 3bf14b552e..8e0d78e48c 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -27,7 +27,7 @@ from calibre.gui2.splash_screen import SplashScreen from calibre.utils.config import dynamic, prefs from calibre.utils.lock import SingleInstance from calibre.utils.monotonic import monotonic -from polyglot.builtins import as_bytes, environ_item, range, unicode_type +from polyglot.builtins import as_bytes, environ_item, unicode_type after_quit_actions = {'debug_on_restart': False, 'restart_after_quit': False, 'no_plugins_on_restart': False} if iswindows: diff --git a/src/calibre/gui2/metadata/basic_widgets.py b/src/calibre/gui2/metadata/basic_widgets.py index 83da23d1a0..e441a06edb 100644 --- a/src/calibre/gui2/metadata/basic_widgets.py +++ b/src/calibre/gui2/metadata/basic_widgets.py @@ -50,7 +50,7 @@ from calibre.utils.date import ( ) from calibre.utils.filenames import make_long_path_useable from calibre.utils.icu import sort_key, strcmp -from polyglot.builtins import iteritems, range, unicode_type +from polyglot.builtins import iteritems, unicode_type def show_locked_file_error(parent, err): diff --git a/src/calibre/gui2/metadata/diff.py b/src/calibre/gui2/metadata/diff.py index 6a69337e6a..bd70e84fb6 100644 --- a/src/calibre/gui2/metadata/diff.py +++ b/src/calibre/gui2/metadata/diff.py @@ -27,7 +27,7 @@ from calibre.gui2.metadata.basic_widgets import PubdateEdit, RatingEdit from calibre.gui2.widgets2 import RightClickButton from calibre.ptempfile import PersistentTemporaryFile from calibre.utils.date import UNDEFINED_DATE -from polyglot.builtins import iteritems, itervalues, map, range, unicode_type, zip +from polyglot.builtins import iteritems, itervalues, unicode_type Widgets = namedtuple('Widgets', 'new old label button') diff --git a/src/calibre/gui2/metadata/single.py b/src/calibre/gui2/metadata/single.py index 6d407bc512..8d5da3ff47 100644 --- a/src/calibre/gui2/metadata/single.py +++ b/src/calibre/gui2/metadata/single.py @@ -34,7 +34,7 @@ from calibre.library.comments import merge_comments as merge_two_comments from calibre.utils.config import tweaks from calibre.utils.date import local_tz from calibre.utils.localization import canonicalize_lang -from polyglot.builtins import filter, iteritems, unicode_type +from polyglot.builtins import iteritems, unicode_type BASE_TITLE = _('Edit metadata') fetched_fields = ('title', 'title_sort', 'authors', 'author_sort', 'series', diff --git a/src/calibre/gui2/metadata/single_download.py b/src/calibre/gui2/metadata/single_download.py index dc8a082df5..a801ff0fdd 100644 --- a/src/calibre/gui2/metadata/single_download.py +++ b/src/calibre/gui2/metadata/single_download.py @@ -37,7 +37,7 @@ from calibre.library.comments import comments_to_html from calibre import force_unicode from calibre.utils.ipc.simple_worker import fork_job, WorkerError from calibre.ptempfile import TemporaryDirectory -from polyglot.builtins import iteritems, itervalues, unicode_type, range, getcwd +from polyglot.builtins import iteritems, itervalues, unicode_type, getcwd from polyglot.queue import Queue, Empty # }}} diff --git a/src/calibre/gui2/open_with.py b/src/calibre/gui2/open_with.py index d2e9218442..2b010197b6 100644 --- a/src/calibre/gui2/open_with.py +++ b/src/calibre/gui2/open_with.py @@ -26,7 +26,7 @@ from calibre.gui2.progress_indicator import ProgressIndicator from calibre.gui2.widgets2 import Dialog from calibre.utils.config import JSONConfig from calibre.utils.icu import numeric_sort_key as sort_key -from polyglot.builtins import iteritems, range, string_or_bytes, unicode_type +from polyglot.builtins import iteritems, string_or_bytes, unicode_type ENTRY_ROLE = Qt.ItemDataRole.UserRole diff --git a/src/calibre/gui2/pin_columns.py b/src/calibre/gui2/pin_columns.py index 029bd46fc4..b19e034794 100644 --- a/src/calibre/gui2/pin_columns.py +++ b/src/calibre/gui2/pin_columns.py @@ -7,7 +7,6 @@ from qt.core import QSplitter, QTableView from calibre.gui2.library import DEFAULT_SORT from calibre.gui2 import gprefs -from polyglot.builtins import range class PinTableView(QTableView): diff --git a/src/calibre/gui2/preferences/behavior.py b/src/calibre/gui2/preferences/behavior.py index 460d1daf94..98b3a5c1d7 100644 --- a/src/calibre/gui2/preferences/behavior.py +++ b/src/calibre/gui2/preferences/behavior.py @@ -21,7 +21,7 @@ from calibre.ebooks import BOOK_EXTENSIONS from calibre.ebooks.oeb.iterator import is_supported from calibre.constants import iswindows from calibre.utils.icu import sort_key -from polyglot.builtins import unicode_type, range +from polyglot.builtins import unicode_type def input_order_drop_event(self, ev): diff --git a/src/calibre/gui2/preferences/columns.py b/src/calibre/gui2/preferences/columns.py index a90def0e62..f2ddf7f663 100644 --- a/src/calibre/gui2/preferences/columns.py +++ b/src/calibre/gui2/preferences/columns.py @@ -15,7 +15,7 @@ from calibre.gui2.preferences import ConfigWidgetBase, test_widget from calibre.gui2.preferences.columns_ui import Ui_Form from calibre.gui2.preferences.create_custom_column import CreateCustomColumn from calibre.gui2 import error_dialog, question_dialog, ALL_COLUMNS -from polyglot.builtins import unicode_type, range, map +from polyglot.builtins import unicode_type class ConfigWidget(ConfigWidgetBase, Ui_Form): diff --git a/src/calibre/gui2/preferences/create_custom_column.py b/src/calibre/gui2/preferences/create_custom_column.py index 31502795be..b635604286 100644 --- a/src/calibre/gui2/preferences/create_custom_column.py +++ b/src/calibre/gui2/preferences/create_custom_column.py @@ -19,7 +19,7 @@ from qt.core import ( from calibre.gui2 import error_dialog from calibre.gui2.dialogs.template_line_editor import TemplateLineEditor from calibre.utils.date import parse_date, UNDEFINED_DATE -from polyglot.builtins import iteritems, unicode_type, range, map +from polyglot.builtins import iteritems, unicode_type class CreateCustomColumn(QDialog): diff --git a/src/calibre/gui2/preferences/emailp.py b/src/calibre/gui2/preferences/emailp.py index 77506c9eb6..7bf851dd20 100644 --- a/src/calibre/gui2/preferences/emailp.py +++ b/src/calibre/gui2/preferences/emailp.py @@ -14,7 +14,7 @@ from calibre.gui2.preferences.email_ui import Ui_Form from calibre.utils.config import ConfigProxy from calibre.utils.icu import numeric_sort_key from calibre.utils.smtp import config as smtp_prefs -from polyglot.builtins import unicode_type, map, as_unicode +from polyglot.builtins import unicode_type, as_unicode class EmailAccounts(QAbstractTableModel): # {{{ diff --git a/src/calibre/gui2/preferences/ignored_devices.py b/src/calibre/gui2/preferences/ignored_devices.py index 04a6d9a48c..8ec8090cc3 100644 --- a/src/calibre/gui2/preferences/ignored_devices.py +++ b/src/calibre/gui2/preferences/ignored_devices.py @@ -12,7 +12,7 @@ from qt.core import ( from calibre.customize.ui import enable_plugin from calibre.gui2 import gprefs from calibre.gui2.preferences import ConfigWidgetBase, test_widget -from polyglot.builtins import iteritems, range +from polyglot.builtins import iteritems class ConfigWidget(ConfigWidgetBase): diff --git a/src/calibre/gui2/preferences/look_feel.py b/src/calibre/gui2/preferences/look_feel.py index 62903ca70e..51f803b337 100644 --- a/src/calibre/gui2/preferences/look_feel.py +++ b/src/calibre/gui2/preferences/look_feel.py @@ -38,7 +38,7 @@ from calibre.gui2.library.alternate_views import auto_height, CM_TO_INCH from calibre.gui2.widgets2 import Dialog from calibre.gui2.actions.show_quickview import get_quickview_action_plugin from calibre.utils.resources import set_data -from polyglot.builtins import iteritems, unicode_type, map +from polyglot.builtins import iteritems, unicode_type class BusyCursor: diff --git a/src/calibre/gui2/preferences/texture_chooser.py b/src/calibre/gui2/preferences/texture_chooser.py index 171848ca56..16feb1f770 100644 --- a/src/calibre/gui2/preferences/texture_chooser.py +++ b/src/calibre/gui2/preferences/texture_chooser.py @@ -14,7 +14,7 @@ from qt.core import ( from calibre.constants import config_dir from calibre.gui2 import choose_files, error_dialog from calibre.utils.icu import sort_key -from polyglot.builtins import unicode_type, range +from polyglot.builtins import unicode_type def texture_dir(): diff --git a/src/calibre/gui2/preferences/tweaks.py b/src/calibre/gui2/preferences/tweaks.py index 22d79e3c28..4a60a4abba 100644 --- a/src/calibre/gui2/preferences/tweaks.py +++ b/src/calibre/gui2/preferences/tweaks.py @@ -26,7 +26,7 @@ from calibre.utils.config_base import ( ) from calibre.utils.icu import lower from calibre.utils.search_query_parser import ParseException, SearchQueryParser -from polyglot.builtins import iteritems, range, unicode_type +from polyglot.builtins import iteritems, unicode_type ROOT = QModelIndex() diff --git a/src/calibre/gui2/search_box.py b/src/calibre/gui2/search_box.py index 762bf0344a..3f94678bfd 100644 --- a/src/calibre/gui2/search_box.py +++ b/src/calibre/gui2/search_box.py @@ -20,7 +20,7 @@ from calibre.gui2.dialogs.confirm_delete import confirm from calibre.gui2.dialogs.saved_search_editor import SavedSearchEditor from calibre.gui2.dialogs.search import SearchDialog from calibre.utils.icu import primary_sort_key -from polyglot.builtins import native_string_type, unicode_type, string_or_bytes, map, range +from polyglot.builtins import native_string_type, unicode_type, string_or_bytes class AsYouType(unicode_type): diff --git a/src/calibre/gui2/store/config/chooser/adv_search_builder.py b/src/calibre/gui2/store/config/chooser/adv_search_builder.py index 36e7922706..d40fd27c84 100644 --- a/src/calibre/gui2/store/config/chooser/adv_search_builder.py +++ b/src/calibre/gui2/store/config/chooser/adv_search_builder.py @@ -12,7 +12,7 @@ from qt.core import (QDialog, QDialogButtonBox) from calibre.gui2.store.config.chooser.adv_search_builder_ui import Ui_Dialog from calibre.library.caches import CONTAINS_MATCH, EQUALS_MATCH from calibre.utils.localization import localize_user_manual_link -from polyglot.builtins import unicode_type, map +from polyglot.builtins import unicode_type class AdvSearchBuilderDialog(QDialog, Ui_Dialog): diff --git a/src/calibre/gui2/store/config/chooser/models.py b/src/calibre/gui2/store/config/chooser/models.py index f07362e877..d31dce3a7b 100644 --- a/src/calibre/gui2/store/config/chooser/models.py +++ b/src/calibre/gui2/store/config/chooser/models.py @@ -16,7 +16,7 @@ from calibre.db.search import CONTAINS_MATCH, EQUALS_MATCH, REGEXP_MATCH, _match from calibre.utils.config_base import prefs from calibre.utils.icu import sort_key from calibre.utils.search_query_parser import SearchQueryParser -from polyglot.builtins import range, unicode_type +from polyglot.builtins import unicode_type class Delegate(QStyledItemDelegate): diff --git a/src/calibre/gui2/store/config/chooser/results_view.py b/src/calibre/gui2/store/config/chooser/results_view.py index 1e53f3d66c..a1b4c0ee8c 100644 --- a/src/calibre/gui2/store/config/chooser/results_view.py +++ b/src/calibre/gui2/store/config/chooser/results_view.py @@ -12,7 +12,6 @@ from qt.core import (Qt, QTreeView, QSize, QMenu) from calibre.customize.ui import store_plugins from calibre.gui2.metadata.single_download import RichTextDelegate from calibre.gui2.store.config.chooser.models import Matches, Delegate -from polyglot.builtins import range class ResultsView(QTreeView): diff --git a/src/calibre/gui2/store/search/download_thread.py b/src/calibre/gui2/store/search/download_thread.py index 9ce8cb1dfa..d10e1e1610 100644 --- a/src/calibre/gui2/store/search/download_thread.py +++ b/src/calibre/gui2/store/search/download_thread.py @@ -12,7 +12,6 @@ from threading import Thread from calibre import browser from calibre.constants import DEBUG from calibre.utils.img import scale_image -from polyglot.builtins import range from polyglot.queue import Queue from polyglot.binary import from_base64_bytes diff --git a/src/calibre/gui2/tag_browser/model.py b/src/calibre/gui2/tag_browser/model.py index 5475239e25..e80f475951 100644 --- a/src/calibre/gui2/tag_browser/model.py +++ b/src/calibre/gui2/tag_browser/model.py @@ -28,7 +28,7 @@ from calibre.utils.icu import ( strcmp ) from calibre.utils.serialize import json_dumps, json_loads -from polyglot.builtins import iteritems, itervalues, map, range, unicode_type +from polyglot.builtins import iteritems, itervalues, unicode_type TAG_SEARCH_STATES = {'clear': 0, 'mark_plus': 1, 'mark_plusplus': 2, 'mark_minus': 3, 'mark_minusminus': 4} diff --git a/src/calibre/gui2/tag_browser/view.py b/src/calibre/gui2/tag_browser/view.py index ecbe116d69..1fba6dda41 100644 --- a/src/calibre/gui2/tag_browser/view.py +++ b/src/calibre/gui2/tag_browser/view.py @@ -26,7 +26,7 @@ from calibre.gui2 import (config, gprefs, choose_files, pixmap_to_data, rating_font, empty_index, question_dialog) from calibre.utils.icu import sort_key from calibre.utils.serialize import json_loads -from polyglot.builtins import unicode_type, range, zip +from polyglot.builtins import unicode_type class TagDelegate(QStyledItemDelegate): # {{{ diff --git a/src/calibre/gui2/tag_mapper.py b/src/calibre/gui2/tag_mapper.py index f589124e7c..c3807cd9e6 100644 --- a/src/calibre/gui2/tag_mapper.py +++ b/src/calibre/gui2/tag_mapper.py @@ -18,7 +18,7 @@ from calibre.gui2.ui import get_gui from calibre.gui2.widgets2 import Dialog from calibre.utils.config import JSONConfig from calibre.utils.localization import localize_user_manual_link -from polyglot.builtins import iteritems, unicode_type, range, filter +from polyglot.builtins import iteritems, unicode_type tag_maps = JSONConfig('tag-map-rules') diff --git a/src/calibre/gui2/toc/location.py b/src/calibre/gui2/toc/location.py index 91e880e481..7ee61d36be 100644 --- a/src/calibre/gui2/toc/location.py +++ b/src/calibre/gui2/toc/location.py @@ -15,7 +15,7 @@ from calibre.gui2.palette import dark_color, dark_link_color, dark_text_color from calibre.gui2.webengine import secure_webengine from calibre.utils.logging import default_log from calibre.utils.short_uuid import uuid4 -from polyglot.builtins import range, unicode_type +from polyglot.builtins import unicode_type class Page(QWebEnginePage): # {{{ diff --git a/src/calibre/gui2/toc/main.py b/src/calibre/gui2/toc/main.py index 980f8ec635..fa67e46d1f 100644 --- a/src/calibre/gui2/toc/main.py +++ b/src/calibre/gui2/toc/main.py @@ -33,7 +33,7 @@ from calibre.ptempfile import reset_base_dir from calibre.utils.config import JSONConfig from calibre.utils.filenames import atomic_rename from calibre.utils.logging import GUILog -from polyglot.builtins import map, range, unicode_type +from polyglot.builtins import unicode_type ICON_SIZE = 24 diff --git a/src/calibre/gui2/tweak_book/__init__.py b/src/calibre/gui2/tweak_book/__init__.py index 02839b60b6..e9f833c3d8 100644 --- a/src/calibre/gui2/tweak_book/__init__.py +++ b/src/calibre/gui2/tweak_book/__init__.py @@ -6,7 +6,7 @@ __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal ' import string -from polyglot.builtins import iteritems, map +from polyglot.builtins import iteritems from calibre.utils.config import JSONConfig from calibre.spell.dictionary import Dictionaries, parse_lang_code diff --git a/src/calibre/gui2/tweak_book/boss.py b/src/calibre/gui2/tweak_book/boss.py index df4eec4b7d..b0f4492796 100644 --- a/src/calibre/gui2/tweak_book/boss.py +++ b/src/calibre/gui2/tweak_book/boss.py @@ -69,9 +69,7 @@ from calibre.utils.config import JSONConfig from calibre.utils.icu import numeric_sort_key from calibre.utils.imghdr import identify from calibre.utils.tdir_in_cache import tdir_in_cache -from polyglot.builtins import ( - as_bytes, iteritems, itervalues, map, string_or_bytes, unicode_type -) +from polyglot.builtins import as_bytes, iteritems, itervalues, string_or_bytes, unicode_type from polyglot.urllib import urlparse _diff_dialogs = [] diff --git a/src/calibre/gui2/tweak_book/char_select.py b/src/calibre/gui2/tweak_book/char_select.py index 8210a7a012..ac3832945c 100644 --- a/src/calibre/gui2/tweak_book/char_select.py +++ b/src/calibre/gui2/tweak_book/char_select.py @@ -22,7 +22,7 @@ from calibre.gui2.widgets2 import HistoryLineEdit2 from calibre.utils.icu import safe_chr as codepoint_to_chr from calibre.utils.unicode_names import character_name_from_code, points_for_word from calibre_extensions.progress_indicator import set_no_activate_on_click -from polyglot.builtins import map, range, unicode_type +from polyglot.builtins import unicode_type ROOT = QModelIndex() diff --git a/src/calibre/gui2/tweak_book/check.py b/src/calibre/gui2/tweak_book/check.py index 1821af5fff..b5470aad7b 100644 --- a/src/calibre/gui2/tweak_book/check.py +++ b/src/calibre/gui2/tweak_book/check.py @@ -17,7 +17,7 @@ from calibre.ebooks.oeb.polish.check.main import run_checks, fix_errors from calibre.gui2 import NO_URL_FORMATTING, safe_open_url from calibre.gui2.tweak_book import tprefs from calibre.gui2.tweak_book.widgets import BusyCursor -from polyglot.builtins import unicode_type, range +from polyglot.builtins import unicode_type def icon_for_level(level): diff --git a/src/calibre/gui2/tweak_book/diff/highlight.py b/src/calibre/gui2/tweak_book/diff/highlight.py index bd4ea28e28..b3cd49051b 100644 --- a/src/calibre/gui2/tweak_book/diff/highlight.py +++ b/src/calibre/gui2/tweak_book/diff/highlight.py @@ -13,7 +13,7 @@ from calibre.gui2.tweak_book import tprefs from calibre.gui2.tweak_book.editor.text import get_highlighter as calibre_highlighter, SyntaxHighlighter from calibre.gui2.tweak_book.editor.themes import get_theme, highlight_to_char_format from calibre.gui2.tweak_book.editor.syntax.utils import format_for_pygments_token, NULL_FMT -from polyglot.builtins import iteritems, range +from polyglot.builtins import iteritems class QtHighlighter(QTextDocument): diff --git a/src/calibre/gui2/tweak_book/diff/main.py b/src/calibre/gui2/tweak_book/diff/main.py index 437eb98e39..23fef397a5 100644 --- a/src/calibre/gui2/tweak_book/diff/main.py +++ b/src/calibre/gui2/tweak_book/diff/main.py @@ -23,7 +23,7 @@ from calibre.gui2.tweak_book.widgets import Dialog from calibre.gui2.widgets2 import HistoryLineEdit2 from calibre.utils.filenames import samefile from calibre.utils.icu import numeric_sort_key -from polyglot.builtins import iteritems, unicode_type, map +from polyglot.builtins import iteritems, unicode_type class BusyWidget(QWidget): # {{{ diff --git a/src/calibre/gui2/tweak_book/diff/view.py b/src/calibre/gui2/tweak_book/diff/view.py index 723fc724ed..012aac1891 100644 --- a/src/calibre/gui2/tweak_book/diff/view.py +++ b/src/calibre/gui2/tweak_book/diff/view.py @@ -28,7 +28,7 @@ from calibre.gui2.tweak_book.editor.text import ( from calibre.gui2.tweak_book.editor.themes import get_theme, theme_color from calibre.utils.icu import utf16_length from calibre.utils.xml_parse import safe_xml_fromstring -from polyglot.builtins import as_bytes, iteritems, map, range, unicode_type, zip +from polyglot.builtins import as_bytes, iteritems, unicode_type Change = namedtuple('Change', 'ltop lbot rtop rbot kind') diff --git a/src/calibre/gui2/tweak_book/download.py b/src/calibre/gui2/tweak_book/download.py index e326bc9c3c..6b0c8e17fe 100644 --- a/src/calibre/gui2/tweak_book/download.py +++ b/src/calibre/gui2/tweak_book/download.py @@ -14,7 +14,7 @@ from calibre.gui2.tweak_book import current_container from calibre.gui2.tweak_book.widgets import Dialog from calibre.gui2.progress_indicator import WaitStack from calibre.ebooks.oeb.polish.download import get_external_resources, download_external_resources, replace_resources -from polyglot.builtins import iteritems, range +from polyglot.builtins import iteritems class ChooseResources(QWidget): diff --git a/src/calibre/gui2/tweak_book/editor/snippets.py b/src/calibre/gui2/tweak_book/editor/snippets.py index d23030b755..8ac4be5c52 100644 --- a/src/calibre/gui2/tweak_book/editor/snippets.py +++ b/src/calibre/gui2/tweak_book/editor/snippets.py @@ -25,9 +25,7 @@ from calibre.gui2.tweak_book.widgets import Dialog, PlainTextEdit from calibre.utils.config import JSONConfig from calibre.utils.icu import string_length as strlen from calibre.utils.localization import localize_user_manual_link -from polyglot.builtins import ( - codepoint_to_chr, iteritems, itervalues, range, unicode_type -) +from polyglot.builtins import codepoint_to_chr, iteritems, itervalues, unicode_type string_length = lambda x: strlen(unicode_type(x)) # Needed on narrow python builds, as subclasses of unicode dont work KEY = Qt.Key.Key_J diff --git a/src/calibre/gui2/tweak_book/editor/text.py b/src/calibre/gui2/tweak_book/editor/text.py index d7b9caa812..b5df71b528 100644 --- a/src/calibre/gui2/tweak_book/editor/text.py +++ b/src/calibre/gui2/tweak_book/editor/text.py @@ -40,7 +40,7 @@ from calibre.utils.icu import ( ) from calibre.utils.img import image_to_data from calibre.utils.titlecase import titlecase -from polyglot.builtins import as_unicode, map, range, unicode_type +from polyglot.builtins import as_unicode, unicode_type def get_highlighter(syntax): diff --git a/src/calibre/gui2/tweak_book/editor/themes.py b/src/calibre/gui2/tweak_book/editor/themes.py index 0ad80ca500..f18610df3e 100644 --- a/src/calibre/gui2/tweak_book/editor/themes.py +++ b/src/calibre/gui2/tweak_book/editor/themes.py @@ -17,7 +17,7 @@ from calibre.gui2 import error_dialog from calibre.gui2.tweak_book import tprefs from calibre.gui2.tweak_book.editor import syntax_text_char_format from calibre.gui2.tweak_book.widgets import Dialog -from polyglot.builtins import iteritems, unicode_type, range, map +from polyglot.builtins import iteritems, unicode_type underline_styles = {'single', 'dash', 'dot', 'dash_dot', 'dash_dot_dot', 'wave', 'spell'} diff --git a/src/calibre/gui2/tweak_book/file_list.py b/src/calibre/gui2/tweak_book/file_list.py index e2f4b5d4d3..e03359dae8 100644 --- a/src/calibre/gui2/tweak_book/file_list.py +++ b/src/calibre/gui2/tweak_book/file_list.py @@ -40,7 +40,7 @@ from calibre.utils.fonts.utils import get_font_names from calibre.utils.icu import numeric_sort_key from calibre_extensions.progress_indicator import set_no_activate_on_click from polyglot.binary import as_hex_unicode -from polyglot.builtins import filter, iteritems, map, range, unicode_type +from polyglot.builtins import iteritems, unicode_type FILE_COPY_MIME = 'application/calibre-edit-book-files' diff --git a/src/calibre/gui2/tweak_book/preferences.py b/src/calibre/gui2/tweak_book/preferences.py index 6cfaf64403..33a52f83ba 100644 --- a/src/calibre/gui2/tweak_book/preferences.py +++ b/src/calibre/gui2/tweak_book/preferences.py @@ -9,8 +9,7 @@ import numbers from operator import attrgetter, methodcaller from functools import partial from collections import namedtuple -from polyglot.builtins import ( - iteritems, itervalues, map, unicode_type, range) +from polyglot.builtins import iteritems, itervalues, unicode_type from itertools import product from copy import copy, deepcopy diff --git a/src/calibre/gui2/tweak_book/reports.py b/src/calibre/gui2/tweak_book/reports.py index 7ed7489519..4fbbffafb6 100644 --- a/src/calibre/gui2/tweak_book/reports.py +++ b/src/calibre/gui2/tweak_book/reports.py @@ -36,7 +36,7 @@ from calibre.gui2.progress_indicator import ProgressIndicator from calibre.utils.icu import primary_contains, numeric_sort_key from calibre.utils.unicode_names import character_name_from_code from calibre.utils.localization import calibre_langcode_to_name, canonicalize_lang -from polyglot.builtins import filter, iteritems, map, range, unicode_type, as_bytes +from polyglot.builtins import iteritems, unicode_type, as_bytes # Utils {{{ diff --git a/src/calibre/gui2/tweak_book/search.py b/src/calibre/gui2/tweak_book/search.py index 0472cad525..75ccfda2a5 100644 --- a/src/calibre/gui2/tweak_book/search.py +++ b/src/calibre/gui2/tweak_book/search.py @@ -37,9 +37,7 @@ from calibre.gui2.tweak_book.function_replace import ( from calibre.gui2.tweak_book.widgets import BusyCursor from calibre.gui2.widgets2 import FlowLayout, HistoryComboBox from calibre.utils.icu import primary_contains -from polyglot.builtins import ( - error_message, filter, iteritems, map, range, unicode_type -) +from polyglot.builtins import error_message, iteritems, unicode_type # The search panel {{{ diff --git a/src/calibre/gui2/tweak_book/spell.py b/src/calibre/gui2/tweak_book/spell.py index ee3ae3aa62..f2c738eee7 100644 --- a/src/calibre/gui2/tweak_book/spell.py +++ b/src/calibre/gui2/tweak_book/spell.py @@ -46,7 +46,7 @@ from calibre.utils.localization import ( calibre_langcode_to_name, canonicalize_lang, get_lang, get_language ) from calibre_extensions.progress_indicator import set_no_activate_on_click -from polyglot.builtins import filter, iteritems, range, unicode_type +from polyglot.builtins import iteritems, unicode_type LANG = 0 COUNTRY = 1 diff --git a/src/calibre/gui2/tweak_book/toc.py b/src/calibre/gui2/tweak_book/toc.py index e697e74d06..7984bb7120 100644 --- a/src/calibre/gui2/tweak_book/toc.py +++ b/src/calibre/gui2/tweak_book/toc.py @@ -17,7 +17,7 @@ from calibre.gui2 import error_dialog, make_view_use_window_background from calibre.gui2.toc.main import ItemEdit, TOCView from calibre.gui2.tweak_book import TOP, actions, current_container, tprefs from calibre_extensions.progress_indicator import set_no_activate_on_click -from polyglot.builtins import range, unicode_type +from polyglot.builtins import unicode_type class TOCEditor(QDialog): diff --git a/src/calibre/gui2/tweak_book/ui.py b/src/calibre/gui2/tweak_book/ui.py index eb54946c9b..de51050013 100644 --- a/src/calibre/gui2/tweak_book/ui.py +++ b/src/calibre/gui2/tweak_book/ui.py @@ -52,7 +52,7 @@ from calibre.utils.localization import ( localize_user_manual_link, localize_website_link ) from calibre.utils.unicode_names import character_name_from_code -from polyglot.builtins import iteritems, itervalues, map, range, unicode_type +from polyglot.builtins import iteritems, itervalues, unicode_type def open_donate(): diff --git a/src/calibre/gui2/tweak_book/widgets.py b/src/calibre/gui2/tweak_book/widgets.py index d95adbe2b0..ab93e6f5b6 100644 --- a/src/calibre/gui2/tweak_book/widgets.py +++ b/src/calibre/gui2/tweak_book/widgets.py @@ -26,10 +26,9 @@ from calibre.gui2.widgets2 import Dialog as BaseDialog, HistoryComboBox, to_plai from calibre.utils.icu import primary_sort_key, sort_key, primary_contains, numeric_sort_key from calibre.utils.matcher import get_char, Matcher, DEFAULT_LEVEL1, DEFAULT_LEVEL2, DEFAULT_LEVEL3 from calibre.gui2.complete2 import EditWithComplete -from polyglot.builtins import iteritems, unicode_type, zip, getcwd, filter as ignore_me +from polyglot.builtins import iteritems, unicode_type, getcwd ROOT = QModelIndex() -ignore_me class BusyCursor: diff --git a/src/calibre/gui2/update.py b/src/calibre/gui2/update.py index 77d46f01de..3308dde971 100644 --- a/src/calibre/gui2/update.py +++ b/src/calibre/gui2/update.py @@ -19,7 +19,7 @@ from calibre.gui2 import config, dynamic, open_url from calibre.gui2.dialogs.plugin_updater import get_plugin_updates_available from calibre.utils.serialize import msgpack_dumps, msgpack_loads from polyglot.binary import as_hex_unicode, from_hex_bytes -from polyglot.builtins import map, unicode_type +from polyglot.builtins import unicode_type URL = 'https://code.calibre-ebook.com/latest' # URL = 'http://localhost:8000/latest' diff --git a/src/calibre/gui2/viewer/bookmarks.py b/src/calibre/gui2/viewer/bookmarks.py index 49c1a4e905..017f2123da 100644 --- a/src/calibre/gui2/viewer/bookmarks.py +++ b/src/calibre/gui2/viewer/bookmarks.py @@ -17,7 +17,7 @@ from calibre.gui2.viewer.shortcuts import get_shortcut_for from calibre.gui2.viewer.web_view import vprefs from calibre.utils.date import EPOCH, utcnow from calibre.utils.icu import primary_sort_key -from polyglot.builtins import range, unicode_type +from polyglot.builtins import unicode_type class BookmarksList(QListWidget): diff --git a/src/calibre/gui2/viewer/highlights.py b/src/calibre/gui2/viewer/highlights.py index 98f1beea30..ef62783eee 100644 --- a/src/calibre/gui2/viewer/highlights.py +++ b/src/calibre/gui2/viewer/highlights.py @@ -29,7 +29,6 @@ from calibre.gui2.viewer.search import SearchInput from calibre.gui2.viewer.shortcuts import get_shortcut_for, index_to_key_sequence from calibre.gui2.widgets2 import Dialog from calibre_extensions.progress_indicator import set_no_activate_on_click -from polyglot.builtins import range decoration_cache = {} diff --git a/src/calibre/gui2/viewer/search.py b/src/calibre/gui2/viewer/search.py index 59986fa80d..f1263e3c1f 100644 --- a/src/calibre/gui2/viewer/search.py +++ b/src/calibre/gui2/viewer/search.py @@ -18,7 +18,7 @@ from calibre.gui2.progress_indicator import ProgressIndicator from calibre.gui2.viewer.config import vprefs from calibre.gui2.viewer.web_view import get_data, get_manifest from calibre.gui2.viewer.widgets import ResultsDelegate, SearchBox -from polyglot.builtins import iteritems, map, unicode_type +from polyglot.builtins import iteritems, unicode_type from polyglot.functools import lru_cache from polyglot.queue import Queue diff --git a/src/calibre/gui2/widgets.py b/src/calibre/gui2/widgets.py index 5911ee6ae4..9dc39e1119 100644 --- a/src/calibre/gui2/widgets.py +++ b/src/calibre/gui2/widgets.py @@ -25,7 +25,7 @@ from calibre.gui2.progress_indicator import ProgressIndicator as _ProgressIndica from calibre.gui2.dnd import (dnd_has_image, dnd_get_image, dnd_get_files, image_extensions, dnd_has_extension, dnd_get_local_image_and_pixmap, DownloadDialog) from calibre.utils.localization import localize_user_manual_link -from polyglot.builtins import native_string_type, unicode_type, range +from polyglot.builtins import native_string_type, unicode_type history = XMLConfig('history') diff --git a/src/calibre/gui2/win_file_dialogs.py b/src/calibre/gui2/win_file_dialogs.py index 729751c28e..6fc619aabe 100644 --- a/src/calibre/gui2/win_file_dialogs.py +++ b/src/calibre/gui2/win_file_dialogs.py @@ -12,7 +12,7 @@ from uuid import uuid4 from contextlib import suppress -from polyglot.builtins import filter, string_or_bytes, unicode_type +from polyglot.builtins import string_or_bytes, unicode_type is64bit = sys.maxsize > (1 << 32) base = sys.extensions_location if hasattr(sys, 'new_app_layout') else os.path.dirname(sys.executable) diff --git a/src/calibre/gui2/wizard/__init__.py b/src/calibre/gui2/wizard/__init__.py index 21622601f0..a0a4738706 100644 --- a/src/calibre/gui2/wizard/__init__.py +++ b/src/calibre/gui2/wizard/__init__.py @@ -26,7 +26,7 @@ from calibre.gui2.wizard.send_email import smtp_prefs from calibre.gui2.wizard.stanza_ui import Ui_WizardPage as StanzaUI from calibre.utils.config import dynamic, prefs from calibre.utils.localization import localize_user_manual_link -from polyglot.builtins import iteritems, map, unicode_type +from polyglot.builtins import iteritems, unicode_type # Devices {{{ diff --git a/src/calibre/library/__init__.py b/src/calibre/library/__init__.py index c70078bd93..2772be8144 100644 --- a/src/calibre/library/__init__.py +++ b/src/calibre/library/__init__.py @@ -7,7 +7,6 @@ __copyright__ = '2008, Kovid Goyal ' import os -from polyglot.builtins import range def db(path=None, read_only=False): diff --git a/src/calibre/library/caches.py b/src/calibre/library/caches.py index 9ce4ae694f..43db8ae9da 100644 --- a/src/calibre/library/caches.py +++ b/src/calibre/library/caches.py @@ -20,8 +20,7 @@ from calibre.db.search import CONTAINS_MATCH, EQUALS_MATCH, REGEXP_MATCH, _match from calibre.ebooks.metadata import title_sort, author_to_author_sort from calibre.ebooks.metadata.opf2 import metadata_to_opf from calibre import prints, force_unicode -from polyglot.builtins import (iteritems, itervalues, map, - unicode_type, string_or_bytes, zip, cmp) +from polyglot.builtins import iteritems, itervalues, unicode_type, string_or_bytes, cmp class MetadataBackup(Thread): # {{{ diff --git a/src/calibre/library/catalogs/bibtex.py b/src/calibre/library/catalogs/bibtex.py index 6ef4a65bda..ae572e6607 100644 --- a/src/calibre/library/catalogs/bibtex.py +++ b/src/calibre/library/catalogs/bibtex.py @@ -14,7 +14,7 @@ from calibre.customize import CatalogPlugin from calibre.library.catalogs import FIELDS, TEMPLATE_ALLOWED_FIELDS from calibre.customize.conversion import DummyReporter from calibre.ebooks.metadata import format_isbn -from polyglot.builtins import filter, string_or_bytes, unicode_type +from polyglot.builtins import string_or_bytes, unicode_type class BIBTEX(CatalogPlugin): diff --git a/src/calibre/library/catalogs/epub_mobi_builder.py b/src/calibre/library/catalogs/epub_mobi_builder.py index e80b2c0798..e83bde404f 100644 --- a/src/calibre/library/catalogs/epub_mobi_builder.py +++ b/src/calibre/library/catalogs/epub_mobi_builder.py @@ -43,7 +43,7 @@ from calibre.utils.icu import capitalize, collation_order, sort_key from calibre.utils.img import scale_image from calibre.utils.localization import get_lang, lang_as_iso639_1 from calibre.utils.zipfile import ZipFile -from polyglot.builtins import iteritems, map, unicode_type, zip +from polyglot.builtins import iteritems, unicode_type NBSP = '\u00a0' diff --git a/src/calibre/library/check_library.py b/src/calibre/library/check_library.py index 4a0112af26..26ddd7346f 100644 --- a/src/calibre/library/check_library.py +++ b/src/calibre/library/check_library.py @@ -11,7 +11,7 @@ import re, os, traceback, fnmatch from calibre import isbytestring from calibre.constants import filesystem_encoding from calibre.ebooks import BOOK_EXTENSIONS -from polyglot.builtins import iteritems, filter +from polyglot.builtins import iteritems EBOOK_EXTENSIONS = frozenset(BOOK_EXTENSIONS) NORMALS = frozenset(['metadata.opf', 'cover.jpg']) diff --git a/src/calibre/library/coloring.py b/src/calibre/library/coloring.py index 755192343f..4420fc32ad 100644 --- a/src/calibre/library/coloring.py +++ b/src/calibre/library/coloring.py @@ -8,7 +8,6 @@ import re from textwrap import dedent from polyglot.binary import as_hex_unicode, from_hex_bytes -from polyglot.builtins import map color_row_key = '*row' diff --git a/src/calibre/library/database.py b/src/calibre/library/database.py index d0ee2f88a3..ebddafcf24 100644 --- a/src/calibre/library/database.py +++ b/src/calibre/library/database.py @@ -15,7 +15,7 @@ from calibre.ebooks.metadata import MetaInformation from calibre.ebooks.metadata import string_to_authors from calibre.utils.serialize import pickle_loads, pickle_dumps from calibre import isbytestring -from polyglot.builtins import unicode_type, filter, map +from polyglot.builtins import unicode_type class Concatenate: diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index 2209fc8333..61c48218e2 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -49,7 +49,7 @@ from calibre.db.lazy import FormatMetadata, FormatsList from calibre.db.categories import Tag, CATEGORY_SORTS from calibre.utils.localization import (canonicalize_lang, calibre_langcode_to_name) -from polyglot.builtins import iteritems, unicode_type, string_or_bytes, map +from polyglot.builtins import iteritems, unicode_type, string_or_bytes copyfile = os.link if hasattr(os, 'link') else shutil.copyfile SPOOL_SIZE = 30*1024*1024 diff --git a/src/calibre/library/restore.py b/src/calibre/library/restore.py index 9648f94097..48d8320a53 100644 --- a/src/calibre/library/restore.py +++ b/src/calibre/library/restore.py @@ -17,7 +17,7 @@ from calibre.library.prefs import DBPrefs from calibre.constants import filesystem_encoding from calibre.utils.date import utcfromtimestamp from calibre import isbytestring -from polyglot.builtins import iteritems, filter +from polyglot.builtins import iteritems NON_EBOOK_EXTENSIONS = frozenset([ 'jpg', 'jpeg', 'gif', 'png', 'bmp', diff --git a/src/calibre/ptempfile.py b/src/calibre/ptempfile.py index bb6e3461d1..19378cb6e7 100644 --- a/src/calibre/ptempfile.py +++ b/src/calibre/ptempfile.py @@ -6,7 +6,7 @@ Provides platform independent temporary files that persist even after being closed. """ import tempfile, os, atexit -from polyglot.builtins import map, getenv +from polyglot.builtins import getenv from calibre.constants import (__version__, __appname__, filesystem_encoding, iswindows, get_windows_temp_path, ismacos) diff --git a/src/calibre/spell/dictionary.py b/src/calibre/spell/dictionary.py index 963f50d7ed..bff129ae22 100644 --- a/src/calibre/spell/dictionary.py +++ b/src/calibre/spell/dictionary.py @@ -19,7 +19,7 @@ from calibre.spell import parse_lang_code from calibre.utils.config import JSONConfig from calibre.utils.icu import capitalize from calibre.utils.localization import get_lang, get_system_locale -from polyglot.builtins import filter, iteritems, itervalues, map, unicode_type +from polyglot.builtins import iteritems, itervalues, unicode_type Dictionary = namedtuple('Dictionary', 'primary_locale locales dicpath affpath builtin name id') LoadedDictionary = namedtuple('Dictionary', 'primary_locale locales obj builtin name id') diff --git a/src/calibre/srv/ajax.py b/src/calibre/srv/ajax.py index 74507f7f19..2ea45c4642 100644 --- a/src/calibre/srv/ajax.py +++ b/src/calibre/srv/ajax.py @@ -6,7 +6,7 @@ __license__ = 'GPL v3' __copyright__ = '2015, Kovid Goyal ' from functools import partial -from polyglot.builtins import iteritems, itervalues, unicode_type, zip, string_or_bytes, map +from polyglot.builtins import iteritems, itervalues, unicode_type, string_or_bytes from itertools import cycle from calibre import force_unicode diff --git a/src/calibre/srv/books.py b/src/calibre/srv/books.py index a0e3a7b487..8cedfcf0d7 100644 --- a/src/calibre/srv/books.py +++ b/src/calibre/srv/books.py @@ -21,7 +21,7 @@ from calibre.srv.routes import endpoint, json from calibre.srv.utils import get_db, get_library_data from calibre.utils.filenames import rmtree from calibre.utils.serialize import json_dumps -from polyglot.builtins import as_unicode, itervalues, map +from polyglot.builtins import as_unicode, itervalues cache_lock = RLock() queued_jobs = {} diff --git a/src/calibre/srv/changes.py b/src/calibre/srv/changes.py index fcde249177..9d9e29b233 100644 --- a/src/calibre/srv/changes.py +++ b/src/calibre/srv/changes.py @@ -3,9 +3,6 @@ # License: GPLv3 Copyright: 2017, Kovid Goyal -from polyglot.builtins import map - - class ChangeEvent: def __init__(self): diff --git a/src/calibre/srv/content.py b/src/calibre/srv/content.py index 3e2826873b..9d2c614f68 100644 --- a/src/calibre/srv/content.py +++ b/src/calibre/srv/content.py @@ -9,7 +9,7 @@ import os, errno from io import BytesIO from threading import Lock from contextlib import suppress -from polyglot.builtins import map, unicode_type +from polyglot.builtins import unicode_type from functools import partial from calibre import fit_image, sanitize_file_name diff --git a/src/calibre/srv/handler.py b/src/calibre/srv/handler.py index 6842d30faa..d2451cc556 100644 --- a/src/calibre/srv/handler.py +++ b/src/calibre/srv/handler.py @@ -15,7 +15,7 @@ from calibre.srv.routes import Router from calibre.srv.users import UserManager from calibre.utils.date import utcnow from calibre.utils.search_query_parser import ParseException -from polyglot.builtins import itervalues, filter, unicode_type +from polyglot.builtins import itervalues, unicode_type class Context: diff --git a/src/calibre/srv/http_request.py b/src/calibre/srv/http_request.py index 394fc2e0cf..a27ecaff92 100644 --- a/src/calibre/srv/http_request.py +++ b/src/calibre/srv/http_request.py @@ -15,7 +15,7 @@ from calibre.srv.loop import Connection, READ, WRITE from calibre.srv.utils import MultiDict, HTTP1, HTTP11, Accumulator from polyglot import http_client, reprlib from polyglot.urllib import unquote -from polyglot.builtins import error_message, filter +from polyglot.builtins import error_message protocol_map = {(1, 0):HTTP1, (1, 1):HTTP11} quoted_slash = re.compile(br'%2[fF]') diff --git a/src/calibre/srv/http_response.py b/src/calibre/srv/http_response.py index b180af31b6..274a0b0105 100644 --- a/src/calibre/srv/http_response.py +++ b/src/calibre/srv/http_response.py @@ -29,7 +29,7 @@ from calibre.utils.monotonic import monotonic from calibre.utils.speedups import ReadOnlyFileBuffer from polyglot import http_client, reprlib from polyglot.builtins import ( - error_message, iteritems, itervalues, map, reraise, string_or_bytes, + error_message, iteritems, itervalues, reraise, string_or_bytes, unicode_type ) diff --git a/src/calibre/srv/legacy.py b/src/calibre/srv/legacy.py index c3a782e668..16a8f14703 100644 --- a/src/calibre/srv/legacy.py +++ b/src/calibre/srv/legacy.py @@ -18,7 +18,7 @@ from calibre.srv.routes import endpoint from calibre.srv.utils import get_library_data, http_date from calibre.utils.cleantext import clean_xml_chars from calibre.utils.date import dt_as_local, is_date_undefined, timestampfromdt -from polyglot.builtins import iteritems, string_or_bytes, filter, as_bytes, unicode_type +from polyglot.builtins import iteritems, string_or_bytes, as_bytes, unicode_type from polyglot.urllib import urlencode # /mobile {{{ diff --git a/src/calibre/srv/manage_users_cli.py b/src/calibre/srv/manage_users_cli.py index d00a99be54..9dcce94041 100644 --- a/src/calibre/srv/manage_users_cli.py +++ b/src/calibre/srv/manage_users_cli.py @@ -8,7 +8,7 @@ from functools import partial from calibre import prints from calibre.constants import preferred_encoding, iswindows from calibre.utils.config import OptionParser -from polyglot.builtins import iteritems, raw_input, filter, unicode_type +from polyglot.builtins import iteritems, raw_input, unicode_type def create_subcommand_parser(name, usage): diff --git a/src/calibre/srv/metadata.py b/src/calibre/srv/metadata.py index eb6cc56875..e2feb62506 100644 --- a/src/calibre/srv/metadata.py +++ b/src/calibre/srv/metadata.py @@ -21,7 +21,7 @@ from calibre.utils.icu import collation_order from calibre.utils.localization import calibre_langcode_to_name from calibre.library.comments import comments_to_html, markdown from calibre.library.field_metadata import category_icon_map -from polyglot.builtins import iteritems, itervalues, range, filter, unicode_type +from polyglot.builtins import iteritems, itervalues, unicode_type from polyglot.urllib import quote IGNORED_FIELDS = frozenset('cover ondevice path marked au_map'.split()) diff --git a/src/calibre/srv/opds.py b/src/calibre/srv/opds.py index 0d442cdeb8..30aca1aa01 100644 --- a/src/calibre/srv/opds.py +++ b/src/calibre/srv/opds.py @@ -28,7 +28,7 @@ from calibre.utils.icu import sort_key from calibre.utils.search_query_parser import ParseException from calibre.utils.xml_parse import safe_xml_fromstring from polyglot.binary import as_hex_unicode, from_hex_unicode -from polyglot.builtins import as_bytes, filter, iteritems, unicode_type +from polyglot.builtins import as_bytes, iteritems, unicode_type from polyglot.urllib import unquote_plus, urlencode diff --git a/src/calibre/srv/pool.py b/src/calibre/srv/pool.py index b7ce2e2d06..53ceedfcaa 100644 --- a/src/calibre/srv/pool.py +++ b/src/calibre/srv/pool.py @@ -9,7 +9,6 @@ import sys from threading import Thread from calibre.utils.monotonic import monotonic -from polyglot.builtins import range from polyglot.queue import Queue, Full diff --git a/src/calibre/srv/render_book.py b/src/calibre/srv/render_book.py index 6c82ad375c..72e760bd49 100644 --- a/src/calibre/srv/render_book.py +++ b/src/calibre/srv/render_book.py @@ -47,7 +47,7 @@ from polyglot.binary import ( as_base64_unicode as encode_component, from_base64_bytes, from_base64_unicode as decode_component ) -from polyglot.builtins import as_bytes, iteritems, map, unicode_type +from polyglot.builtins import as_bytes, iteritems, unicode_type from polyglot.urllib import quote, urlparse RENDER_VERSION = 1 diff --git a/src/calibre/srv/routes.py b/src/calibre/srv/routes.py index 052fdd86f0..e7713700f9 100644 --- a/src/calibre/srv/routes.py +++ b/src/calibre/srv/routes.py @@ -11,7 +11,7 @@ from operator import attrgetter from calibre.srv.errors import HTTPSimpleResponse, HTTPNotFound, RouteError from calibre.srv.utils import http_date from calibre.utils.serialize import msgpack_dumps, json_dumps, MSGPACK_MIME -from polyglot.builtins import iteritems, itervalues, unicode_type, range, zip, filter +from polyglot.builtins import iteritems, itervalues, unicode_type from polyglot import http_client from polyglot.urllib import quote as urlquote diff --git a/src/calibre/srv/tests/auth.py b/src/calibre/srv/tests/auth.py index ec9c955fab..4ed05922a5 100644 --- a/src/calibre/srv/tests/auth.py +++ b/src/calibre/srv/tests/auth.py @@ -16,7 +16,7 @@ from calibre.ptempfile import TemporaryDirectory from calibre.srv.errors import HTTPForbidden from calibre.srv.tests.base import BaseTest, TestServer from calibre.srv.routes import endpoint, Router -from polyglot.builtins import iteritems, itervalues, map +from polyglot.builtins import iteritems, itervalues from polyglot import http_client from polyglot.http_cookie import CookieJar from polyglot.urllib import (build_opener, HTTPBasicAuthHandler, diff --git a/src/calibre/srv/tests/http.py b/src/calibre/srv/tests/http.py index 2fb59521ca..3c03e09dbe 100644 --- a/src/calibre/srv/tests/http.py +++ b/src/calibre/srv/tests/http.py @@ -13,7 +13,7 @@ from calibre import guess_type from calibre.srv.tests.base import BaseTest, TestServer from calibre.srv.utils import eintr_retry_call from calibre.utils.monotonic import monotonic -from polyglot.builtins import iteritems, range, unicode_type +from polyglot.builtins import iteritems, unicode_type from polyglot import http_client is_ci = os.environ.get('CI', '').lower() == 'true' diff --git a/src/calibre/srv/tests/loop.py b/src/calibre/srv/tests/loop.py index 18a965547b..17e7fd56b4 100644 --- a/src/calibre/srv/tests/loop.py +++ b/src/calibre/srv/tests/loop.py @@ -16,7 +16,7 @@ from calibre.srv.tests.base import BaseTest, TestServer from calibre.ptempfile import TemporaryDirectory from calibre.utils.certgen import create_server_cert from calibre.utils.monotonic import monotonic -from polyglot.builtins import range, unicode_type, map +from polyglot.builtins import unicode_type from polyglot import http_client is_ci = os.environ.get('CI', '').lower() == 'true' diff --git a/src/calibre/srv/tests/routes.py b/src/calibre/srv/tests/routes.py index c611468148..c1cbaeccc4 100644 --- a/src/calibre/srv/tests/routes.py +++ b/src/calibre/srv/tests/routes.py @@ -7,7 +7,7 @@ __copyright__ = '2015, Kovid Goyal ' import os from calibre.srv.tests.base import BaseTest -from polyglot.builtins import itervalues, filter +from polyglot.builtins import itervalues from tempfile import TemporaryDirectory diff --git a/src/calibre/srv/tests/web_sockets.py b/src/calibre/srv/tests/web_sockets.py index 8dbb2271b4..6b3159e4d5 100644 --- a/src/calibre/srv/tests/web_sockets.py +++ b/src/calibre/srv/tests/web_sockets.py @@ -14,7 +14,7 @@ from calibre.srv.web_socket import ( PING, PONG, PROTOCOL_ERROR, CONTINUATION, INCONSISTENT_DATA, CONTROL_CODES) from calibre.utils.monotonic import monotonic from calibre.utils.socket_inheritance import set_socket_inherit -from polyglot.builtins import range, unicode_type +from polyglot.builtins import unicode_type from polyglot.binary import as_base64_unicode HANDSHAKE_STR = '''\ diff --git a/src/calibre/srv/utils.py b/src/calibre/srv/utils.py index d384114dee..7b85a0286a 100644 --- a/src/calibre/srv/utils.py +++ b/src/calibre/srv/utils.py @@ -16,7 +16,7 @@ from calibre.utils.localization import get_translator from calibre.utils.socket_inheritance import set_socket_inherit from calibre.utils.logging import ThreadSafeLog from calibre.utils.shared_file import share_open -from polyglot.builtins import iteritems, map, range +from polyglot.builtins import iteritems from polyglot import reprlib from polyglot.http_cookie import SimpleCookie from polyglot.builtins import unicode_type, as_unicode diff --git a/src/calibre/test_build.py b/src/calibre/test_build.py index 1de72c4fcf..992bdcb52f 100644 --- a/src/calibre/test_build.py +++ b/src/calibre/test_build.py @@ -13,7 +13,7 @@ Test a binary calibre build to ensure that all needed binary images/libraries ha import os, ctypes, sys, unittest, time, shutil from calibre.constants import iswindows, islinux, ismacos, plugins_loc -from polyglot.builtins import iteritems, map, unicode_type, getenv +from polyglot.builtins import iteritems, unicode_type, getenv is_ci = os.environ.get('CI', '').lower() == 'true' is_sanitized = 'libasan' in os.environ.get('LD_PRELOAD', '') diff --git a/src/calibre/utils/cleantext.py b/src/calibre/utils/cleantext.py index 5a0583ef6c..cd66ec6eaa 100644 --- a/src/calibre/utils/cleantext.py +++ b/src/calibre/utils/cleantext.py @@ -7,7 +7,7 @@ import re from calibre.constants import preferred_encoding from calibre_extensions.speedup import clean_xml_chars as _ncxc -from polyglot.builtins import codepoint_to_chr, filter, map, range +from polyglot.builtins import codepoint_to_chr from polyglot.html_entities import name2codepoint diff --git a/src/calibre/utils/config_base.py b/src/calibre/utils/config_base.py index cd2e19118a..0a8374aed4 100644 --- a/src/calibre/utils/config_base.py +++ b/src/calibre/utils/config_base.py @@ -12,7 +12,7 @@ from copy import deepcopy from calibre.utils.lock import ExclusiveFile from calibre.constants import config_dir, CONFIG_DIR_MODE, preferred_encoding, filesystem_encoding, iswindows -from polyglot.builtins import unicode_type, iteritems, map +from polyglot.builtins import unicode_type, iteritems plugin_dir = os.path.join(config_dir, 'plugins') diff --git a/src/calibre/utils/filenames.py b/src/calibre/utils/filenames.py index a3c590ab18..252ecbd6fd 100644 --- a/src/calibre/utils/filenames.py +++ b/src/calibre/utils/filenames.py @@ -16,7 +16,7 @@ from calibre.constants import ( filesystem_encoding, iswindows, preferred_encoding, ismacos ) from calibre.utils.localization import get_udc -from polyglot.builtins import iteritems, itervalues, unicode_type, range +from polyglot.builtins import iteritems, itervalues, unicode_type def ascii_text(orig): diff --git a/src/calibre/utils/fonts/free_type.py b/src/calibre/utils/fonts/free_type.py index 03a80ba3cc..0ef640c95c 100644 --- a/src/calibre/utils/fonts/free_type.py +++ b/src/calibre/utils/fonts/free_type.py @@ -10,7 +10,7 @@ import threading from functools import wraps from calibre_extensions.freetype import FreeType as _FreeType -from polyglot.builtins import map, unicode_type +from polyglot.builtins import unicode_type class ThreadingViolation(Exception): diff --git a/src/calibre/utils/fonts/metadata.py b/src/calibre/utils/fonts/metadata.py index f9cd47dd3c..091f67b845 100644 --- a/src/calibre/utils/fonts/metadata.py +++ b/src/calibre/utils/fonts/metadata.py @@ -11,7 +11,7 @@ from struct import calcsize, unpack, unpack_from from collections import namedtuple from calibre.utils.fonts.utils import get_font_names2, get_font_characteristics -from polyglot.builtins import range, unicode_type +from polyglot.builtins import unicode_type class UnsupportedFont(ValueError): diff --git a/src/calibre/utils/fonts/scanner.py b/src/calibre/utils/fonts/scanner.py index 98b367b8f8..9f693707dd 100644 --- a/src/calibre/utils/fonts/scanner.py +++ b/src/calibre/utils/fonts/scanner.py @@ -15,7 +15,7 @@ from calibre.constants import (config_dir, iswindows, ismacos, DEBUG, isworker, filesystem_encoding) from calibre.utils.fonts.metadata import FontMetadata, UnsupportedFont from calibre.utils.icu import sort_key -from polyglot.builtins import itervalues, unicode_type, filter +from polyglot.builtins import itervalues, unicode_type class NoFonts(ValueError): diff --git a/src/calibre/utils/fonts/sfnt/cff/dict_data.py b/src/calibre/utils/fonts/sfnt/cff/dict_data.py index 47d1457e55..66c76630ee 100644 --- a/src/calibre/utils/fonts/sfnt/cff/dict_data.py +++ b/src/calibre/utils/fonts/sfnt/cff/dict_data.py @@ -7,7 +7,7 @@ __copyright__ = '2012, Kovid Goyal ' __docformat__ = 'restructuredtext en' from struct import pack, unpack_from -from polyglot.builtins import range, unicode_type +from polyglot.builtins import unicode_type t1_operand_encoding = [None] * 256 t1_operand_encoding[0:32] = (32) * ["do_operator"] diff --git a/src/calibre/utils/fonts/sfnt/cff/table.py b/src/calibre/utils/fonts/sfnt/cff/table.py index 02c5a9838c..9bc6b4eefa 100644 --- a/src/calibre/utils/fonts/sfnt/cff/table.py +++ b/src/calibre/utils/fonts/sfnt/cff/table.py @@ -14,7 +14,7 @@ from calibre.utils.fonts.sfnt.errors import UnsupportedFont, NoGlyphs from calibre.utils.fonts.sfnt.cff.dict_data import TopDict, PrivateDict from calibre.utils.fonts.sfnt.cff.constants import (cff_standard_strings, STANDARD_CHARSETS) -from polyglot.builtins import iteritems, itervalues, range +from polyglot.builtins import iteritems, itervalues # Useful links # http://www.adobe.com/content/dam/Adobe/en/devnet/font/pdfs/5176.CFF.pdf diff --git a/src/calibre/utils/fonts/sfnt/cff/writer.py b/src/calibre/utils/fonts/sfnt/cff/writer.py index b556abd5fa..7a74fa3114 100644 --- a/src/calibre/utils/fonts/sfnt/cff/writer.py +++ b/src/calibre/utils/fonts/sfnt/cff/writer.py @@ -10,7 +10,6 @@ from struct import pack from collections import OrderedDict from calibre.utils.fonts.sfnt.cff.constants import cff_standard_strings -from polyglot.builtins import range class Index(list): diff --git a/src/calibre/utils/fonts/sfnt/cmap.py b/src/calibre/utils/fonts/sfnt/cmap.py index 322a658518..d0e706b51e 100644 --- a/src/calibre/utils/fonts/sfnt/cmap.py +++ b/src/calibre/utils/fonts/sfnt/cmap.py @@ -15,7 +15,6 @@ from collections import OrderedDict from calibre.utils.fonts.utils import read_bmp_prefix from calibre.utils.fonts.sfnt import UnknownTable, max_power_of_two from calibre.utils.fonts.sfnt.errors import UnsupportedFont -from polyglot.builtins import range def split_range(start_code, end_code, cmap): # {{{ diff --git a/src/calibre/utils/fonts/sfnt/common.py b/src/calibre/utils/fonts/sfnt/common.py index 3e778fecf7..5f98e736fa 100644 --- a/src/calibre/utils/fonts/sfnt/common.py +++ b/src/calibre/utils/fonts/sfnt/common.py @@ -10,7 +10,7 @@ from struct import unpack_from, calcsize from collections import OrderedDict, namedtuple from calibre.utils.fonts.sfnt.errors import UnsupportedFont -from polyglot.builtins import range, iteritems +from polyglot.builtins import iteritems class Unpackable: diff --git a/src/calibre/utils/fonts/sfnt/head.py b/src/calibre/utils/fonts/sfnt/head.py index 2c9d52645e..3124bb37c3 100644 --- a/src/calibre/utils/fonts/sfnt/head.py +++ b/src/calibre/utils/fonts/sfnt/head.py @@ -12,7 +12,6 @@ from struct import unpack_from, pack, calcsize from calibre.utils.fonts.sfnt import UnknownTable, DateTimeProperty, FixedProperty from calibre.utils.fonts.sfnt.errors import UnsupportedFont from calibre.utils.fonts.sfnt.loca import read_array -from polyglot.builtins import zip class HeadTable(UnknownTable): diff --git a/src/calibre/utils/fonts/sfnt/kern.py b/src/calibre/utils/fonts/sfnt/kern.py index 983e49beb3..5cf90a4418 100644 --- a/src/calibre/utils/fonts/sfnt/kern.py +++ b/src/calibre/utils/fonts/sfnt/kern.py @@ -11,7 +11,6 @@ from struct import unpack_from, calcsize, pack, error as struct_error from calibre.utils.fonts.sfnt import (UnknownTable, FixedProperty, max_power_of_two) from calibre.utils.fonts.sfnt.errors import UnsupportedFont -from polyglot.builtins import range class KernTable(UnknownTable): diff --git a/src/calibre/utils/fonts/sfnt/loca.py b/src/calibre/utils/fonts/sfnt/loca.py index 7cc16444bb..710ac6cea9 100644 --- a/src/calibre/utils/fonts/sfnt/loca.py +++ b/src/calibre/utils/fonts/sfnt/loca.py @@ -11,7 +11,7 @@ from operator import itemgetter from itertools import repeat from calibre.utils.fonts.sfnt import UnknownTable -from polyglot.builtins import iteritems, range +from polyglot.builtins import iteritems def four_byte_type_code(): diff --git a/src/calibre/utils/fonts/sfnt/maxp.py b/src/calibre/utils/fonts/sfnt/maxp.py index 9d5b69d94b..32558f63b5 100644 --- a/src/calibre/utils/fonts/sfnt/maxp.py +++ b/src/calibre/utils/fonts/sfnt/maxp.py @@ -10,7 +10,6 @@ from struct import unpack_from, pack from calibre.utils.fonts.sfnt import UnknownTable, FixedProperty from calibre.utils.fonts.sfnt.errors import UnsupportedFont -from polyglot.builtins import zip class MaxpTable(UnknownTable): diff --git a/src/calibre/utils/fonts/sfnt/metrics.py b/src/calibre/utils/fonts/sfnt/metrics.py index 976a0233de..53ccb38288 100644 --- a/src/calibre/utils/fonts/sfnt/metrics.py +++ b/src/calibre/utils/fonts/sfnt/metrics.py @@ -6,7 +6,7 @@ __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal ' __docformat__ = 'restructuredtext en' -from polyglot.builtins import map, unicode_type +from polyglot.builtins import unicode_type from calibre.utils.fonts.utils import get_all_font_names from calibre.utils.fonts.sfnt.container import UnsupportedFont diff --git a/src/calibre/utils/fonts/sfnt/subset.py b/src/calibre/utils/fonts/sfnt/subset.py index 6652fe4c96..368eac9317 100644 --- a/src/calibre/utils/fonts/sfnt/subset.py +++ b/src/calibre/utils/fonts/sfnt/subset.py @@ -14,7 +14,7 @@ from functools import partial from calibre.utils.icu import safe_chr, ord_string from calibre.utils.fonts.sfnt.container import Sfnt from calibre.utils.fonts.sfnt.errors import UnsupportedFont, NoGlyphs -from polyglot.builtins import unicode_type, range, iteritems, itervalues, map +from polyglot.builtins import unicode_type, iteritems, itervalues # TrueType outlines {{{ diff --git a/src/calibre/utils/fonts/utils.py b/src/calibre/utils/fonts/utils.py index 8a281f1722..042411c0f9 100644 --- a/src/calibre/utils/fonts/utils.py +++ b/src/calibre/utils/fonts/utils.py @@ -10,7 +10,7 @@ import struct from io import BytesIO from collections import defaultdict -from polyglot.builtins import iteritems, itervalues, unicode_type, range, as_bytes +from polyglot.builtins import iteritems, itervalues, unicode_type, as_bytes class UnsupportedFont(ValueError): diff --git a/src/calibre/utils/icu.py b/src/calibre/utils/icu.py index ff1e516ace..a47c1c00dd 100644 --- a/src/calibre/utils/icu.py +++ b/src/calibre/utils/icu.py @@ -11,7 +11,7 @@ import sys from calibre.utils.config_base import tweaks from calibre_extensions import icu as _icu -from polyglot.builtins import cmp, filter, unicode_type +from polyglot.builtins import cmp, unicode_type _locale = _collator = _primary_collator = _sort_collator = _numeric_collator = _case_sensitive_collator = None cmp diff --git a/src/calibre/utils/matcher.py b/src/calibre/utils/matcher.py index 2d77b40059..5a5d19f9ce 100644 --- a/src/calibre/utils/matcher.py +++ b/src/calibre/utils/matcher.py @@ -16,7 +16,7 @@ from itertools import islice from calibre import detect_ncpus as cpu_count, as_unicode from calibre.constants import filesystem_encoding from calibre.utils.icu import primary_sort_key, primary_find, primary_collator -from polyglot.builtins import iteritems, itervalues, map, unicode_type, range, zip, raw_input, filter, getcwd +from polyglot.builtins import iteritems, itervalues, unicode_type, raw_input, getcwd from polyglot.queue import Queue DEFAULT_LEVEL1 = '/' diff --git a/src/calibre/utils/open_with/windows.py b/src/calibre/utils/open_with/windows.py index b63a45a9f9..086cad30c7 100644 --- a/src/calibre/utils/open_with/windows.py +++ b/src/calibre/utils/open_with/windows.py @@ -12,7 +12,6 @@ from qt.core import QBuffer, QByteArray, QPixmap, Qt, QtWin, QIODevice from calibre.gui2 import must_use_qt from calibre.utils.winreg.default_programs import split_commandline from calibre_extensions import winutil -from polyglot.builtins import filter ICON_SIZE = 256 diff --git a/src/calibre/utils/rapydscript.py b/src/calibre/utils/rapydscript.py index a7f0451724..7a27389fa0 100644 --- a/src/calibre/utils/rapydscript.py +++ b/src/calibre/utils/rapydscript.py @@ -17,7 +17,7 @@ from calibre.constants import ( ) from calibre.ptempfile import TemporaryDirectory from calibre.utils.filenames import atomic_rename -from polyglot.builtins import as_bytes, as_unicode, exec_path, unicode_type, zip +from polyglot.builtins import as_bytes, as_unicode, exec_path, unicode_type COMPILER_PATH = 'rapydscript/compiler.js.xz' special_title = '__webengine_messages_pending__' diff --git a/src/calibre/utils/terminal.py b/src/calibre/utils/terminal.py index fb3351083b..aea2e94b69 100644 --- a/src/calibre/utils/terminal.py +++ b/src/calibre/utils/terminal.py @@ -9,7 +9,7 @@ import os, sys, re from calibre.prints import is_binary from calibre.constants import iswindows -from polyglot.builtins import iteritems, range, zip +from polyglot.builtins import iteritems if iswindows: import ctypes.wintypes diff --git a/src/calibre/utils/zipfile.py b/src/calibre/utils/zipfile.py index b9f10a8c4c..8058b34bd8 100644 --- a/src/calibre/utils/zipfile.py +++ b/src/calibre/utils/zipfile.py @@ -18,7 +18,7 @@ from calibre import sanitize_file_name from calibre.constants import filesystem_encoding from calibre.ebooks.chardet import detect from calibre.ptempfile import SpooledTemporaryFile -from polyglot.builtins import getcwd, map, string_or_bytes, unicode_type, as_bytes +from polyglot.builtins import getcwd, string_or_bytes, unicode_type, as_bytes try: import zlib # We may need its compression method diff --git a/src/calibre/web/feeds/__init__.py b/src/calibre/web/feeds/__init__.py index 741eee146b..ebdedaf3e7 100644 --- a/src/calibre/web/feeds/__init__.py +++ b/src/calibre/web/feeds/__init__.py @@ -12,7 +12,7 @@ from calibre.utils.logging import default_log from calibre import entity_to_unicode, strftime, force_unicode from calibre.utils.date import dt_factory, utcnow, local_tz from calibre.utils.cleantext import clean_ascii_chars, clean_xml_chars -from polyglot.builtins import unicode_type, string_or_bytes, map +from polyglot.builtins import unicode_type, string_or_bytes class Article: diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 7c765d6b21..9ffcb3d74b 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -10,7 +10,7 @@ from calibre.web.feeds.news import (BasicNewsRecipe, CustomIndexRecipe, AutomaticNewsRecipe, CalibrePeriodical) from calibre.ebooks.BeautifulSoup import BeautifulSoup from calibre.utils.config import JSONConfig -from polyglot.builtins import itervalues, unicode_type, codepoint_to_chr, range +from polyglot.builtins import itervalues, unicode_type, codepoint_to_chr basic_recipes = (BasicNewsRecipe, AutomaticNewsRecipe, CustomIndexRecipe, CalibrePeriodical) diff --git a/src/css_selectors/parser.py b/src/css_selectors/parser.py index 5b575badbe..2a8be8f31b 100644 --- a/src/css_selectors/parser.py +++ b/src/css_selectors/parser.py @@ -15,7 +15,7 @@ import operator import string from css_selectors.errors import SelectorSyntaxError, ExpressionError -from polyglot.builtins import unicode_type, codepoint_to_chr, range +from polyglot.builtins import unicode_type, codepoint_to_chr utab = {c:c+32 for c in range(ord(u'A'), ord(u'Z')+1)} diff --git a/src/tinycss/fonts3.py b/src/tinycss/fonts3.py index 3e62907b45..f592a66730 100644 --- a/src/tinycss/fonts3.py +++ b/src/tinycss/fonts3.py @@ -7,7 +7,6 @@ __copyright__ = '2014, Kovid Goyal ' import re -from polyglot.builtins import map from tinycss.css21 import CSS21Parser, ParseError from .tokenizer import tokenize_grouped