diff --git a/resources/rapydscript/compiler.js.xz b/resources/rapydscript/compiler.js.xz index 98f0977b93..24964b9076 100644 Binary files a/resources/rapydscript/compiler.js.xz and b/resources/rapydscript/compiler.js.xz differ diff --git a/resources/rapydscript/lib/gettext.pyj b/resources/rapydscript/lib/gettext.pyj index 6e5ec537b6..673d67bf5c 100644 --- a/resources/rapydscript/lib/gettext.pyj +++ b/resources/rapydscript/lib/gettext.pyj @@ -518,7 +518,7 @@ def install(translation_data): t.install() return t -has_prop = Object.prototype.hasOwnProperty +has_prop = Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty) class Translations: @@ -536,14 +536,14 @@ class Translations: def gettext(self, text): for t in self.translations: m = t[0]['entries'] - if has_prop.call(m, text): + if has_prop(m, text): return m[text][0] return text def ngettext(self, text, plural, n): for t in self.translations: m = t[0]['entries'] - if has_prop.call(m, text): + if has_prop(m, text): idx = t[1](n) return m[text][idx] or (text if n is 1 else plural) return text if n is 1 else plural diff --git a/src/calibre/ebooks/oeb/display/test-cfi/cfi-test.pyj b/src/calibre/ebooks/oeb/display/test-cfi/cfi-test.pyj index 74108dc120..478e1c341b 100644 --- a/src/calibre/ebooks/oeb/display/test-cfi/cfi-test.pyj +++ b/src/calibre/ebooks/oeb/display/test-cfi/cfi-test.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal +from __python__ import hash_literals from cfi import scroll_to, at_current, at diff --git a/src/pyj/ajax.pyj b/src/pyj/ajax.pyj index f2492a09ab..c07e78de83 100644 --- a/src/pyj/ajax.pyj +++ b/src/pyj/ajax.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2015, Kovid Goyal +from __python__ import hash_literals from gettext import gettext as _ diff --git a/src/pyj/book_list/book_details.pyj b/src/pyj/book_list/book_details.pyj index 42812806ed..11616732f3 100644 --- a/src/pyj/book_list/book_details.pyj +++ b/src/pyj/book_list/book_details.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal +from __python__ import hash_literals import traceback from ajax import ajax diff --git a/src/pyj/book_list/boss.pyj b/src/pyj/book_list/boss.pyj index 7f5f461e0d..b8c85433ac 100644 --- a/src/pyj/book_list/boss.pyj +++ b/src/pyj/book_list/boss.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2015, Kovid Goyal +from __python__ import hash_literals import traceback from ajax import encode_query diff --git a/src/pyj/book_list/globals.pyj b/src/pyj/book_list/globals.pyj index 64ddcdb5de..5c11f4a056 100644 --- a/src/pyj/book_list/globals.pyj +++ b/src/pyj/book_list/globals.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2015, Kovid Goyal +from __python__ import hash_literals boss = None session_data = None diff --git a/src/pyj/book_list/item_list.pyj b/src/pyj/book_list/item_list.pyj index e6c768f6bc..4b6e6022ba 100644 --- a/src/pyj/book_list/item_list.pyj +++ b/src/pyj/book_list/item_list.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2015, Kovid Goyal +from __python__ import hash_literals from dom import build_rule, svgicon from elementmaker import E diff --git a/src/pyj/book_list/prefs.pyj b/src/pyj/book_list/prefs.pyj index 1aede339b3..e783b76f23 100644 --- a/src/pyj/book_list/prefs.pyj +++ b/src/pyj/book_list/prefs.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal +from __python__ import hash_literals from dom import clear from elementmaker import E diff --git a/src/pyj/book_list/search.pyj b/src/pyj/book_list/search.pyj index 493539dc23..8c2f057446 100644 --- a/src/pyj/book_list/search.pyj +++ b/src/pyj/book_list/search.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2015, Kovid Goyal +from __python__ import hash_literals from ajax import ajax from dom import clear, set_css, build_rule, svgicon diff --git a/src/pyj/book_list/theme.pyj b/src/pyj/book_list/theme.pyj index 59d4ccc9fd..49956bb6c6 100644 --- a/src/pyj/book_list/theme.pyj +++ b/src/pyj/book_list/theme.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2015, Kovid Goyal +from __python__ import hash_literals DARK = '#39322B' LIGHT = '#F6F3E9' diff --git a/src/pyj/book_list/top_bar.pyj b/src/pyj/book_list/top_bar.pyj index 87b0a4bf09..1b774ba448 100644 --- a/src/pyj/book_list/top_bar.pyj +++ b/src/pyj/book_list/top_bar.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2015, Kovid Goyal +from __python__ import hash_literals from book_list.theme import get_color, get_font_size from dom import set_css, clear, create_keyframes, build_rule, svgicon diff --git a/src/pyj/book_list/ui.pyj b/src/pyj/book_list/ui.pyj index 1a0cf74df8..1da234140c 100644 --- a/src/pyj/book_list/ui.pyj +++ b/src/pyj/book_list/ui.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2015, Kovid Goyal +from __python__ import hash_literals import traceback from book_list.globals import get_boss, get_session_data diff --git a/src/pyj/book_list/views.pyj b/src/pyj/book_list/views.pyj index ea99ac247e..5163291c34 100644 --- a/src/pyj/book_list/views.pyj +++ b/src/pyj/book_list/views.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2015, Kovid Goyal +from __python__ import hash_literals import traceback from ajax import ajax_send diff --git a/src/pyj/date.pyj b/src/pyj/date.pyj index c99ed1739e..059647b434 100644 --- a/src/pyj/date.pyj +++ b/src/pyj/date.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal +from __python__ import hash_literals UNDEFINED_DATE = Date('0101-01-01T00:00:00+00:00') diff --git a/src/pyj/dom.pyj b/src/pyj/dom.pyj index 6a4d06dd45..ed6e0c30d8 100644 --- a/src/pyj/dom.pyj +++ b/src/pyj/dom.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2015, Kovid Goyal +from __python__ import hash_literals simple_vendor_prefixes = { 'animation': v"['webkit', 'moz', 'o']", diff --git a/src/pyj/initialize.pyj b/src/pyj/initialize.pyj index 2ca5f6d179..67612d8246 100644 --- a/src/pyj/initialize.pyj +++ b/src/pyj/initialize.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal +from __python__ import hash_literals from pythonize import strings diff --git a/src/pyj/keycodes.pyj b/src/pyj/keycodes.pyj index 66ecc8dd0a..180c0fe04a 100644 --- a/src/pyj/keycodes.pyj +++ b/src/pyj/keycodes.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal +from __python__ import hash_literals KEYCODE_MAP = K = Object.create(None) K[8] = 'backspace' diff --git a/src/pyj/modals.pyj b/src/pyj/modals.pyj index cfd04f8c02..8fb343a839 100644 --- a/src/pyj/modals.pyj +++ b/src/pyj/modals.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2015, Kovid Goyal +from __python__ import hash_literals from ajax import ajax, ajax_send from elementmaker import E diff --git a/src/pyj/read_book/cfi.pyj b/src/pyj/read_book/cfi.pyj index a05596ee06..951f999e0f 100644 --- a/src/pyj/read_book/cfi.pyj +++ b/src/pyj/read_book/cfi.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal +from __python__ import hash_literals # Based on code originally written by Peter Sorotkin # http://code.google.com/p/epub-revision/source/browse/trunk/src/samples/cfi/epubcfi.js diff --git a/src/pyj/read_book/db.pyj b/src/pyj/read_book/db.pyj index 7f8e550fa9..6b683c80db 100644 --- a/src/pyj/read_book/db.pyj +++ b/src/pyj/read_book/db.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal +from __python__ import hash_literals from gettext import gettext as _ from encodings import base64encode, base64decode diff --git a/src/pyj/read_book/flow_mode.pyj b/src/pyj/read_book/flow_mode.pyj index c0f7b5a0b6..0876b639e5 100644 --- a/src/pyj/read_book/flow_mode.pyj +++ b/src/pyj/read_book/flow_mode.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal +from __python__ import hash_literals from dom import set_css from read_book.globals import get_boss diff --git a/src/pyj/read_book/globals.pyj b/src/pyj/read_book/globals.pyj index f3ff4330c1..c69de4c776 100644 --- a/src/pyj/read_book/globals.pyj +++ b/src/pyj/read_book/globals.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal +from __python__ import hash_literals from aes import GCM, random_bytes from encodings import hexlify diff --git a/src/pyj/read_book/iframe.pyj b/src/pyj/read_book/iframe.pyj index d1d888cdb6..8b4c9f807f 100644 --- a/src/pyj/read_book/iframe.pyj +++ b/src/pyj/read_book/iframe.pyj @@ -1,6 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal -from __python__ import bound_methods +from __python__ import bound_methods, hash_literals import traceback from aes import GCM diff --git a/src/pyj/read_book/overlay.pyj b/src/pyj/read_book/overlay.pyj index ca4edbb685..79d959388c 100644 --- a/src/pyj/read_book/overlay.pyj +++ b/src/pyj/read_book/overlay.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal +from __python__ import hash_literals from read_book.globals import iframe_id diff --git a/src/pyj/read_book/resources.pyj b/src/pyj/read_book/resources.pyj index dbe3d7ddc1..75981e8f6d 100644 --- a/src/pyj/read_book/resources.pyj +++ b/src/pyj/read_book/resources.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal +from __python__ import hash_literals from dom import clear from encodings import base64decode, utf8_decode diff --git a/src/pyj/read_book/settings.pyj b/src/pyj/read_book/settings.pyj index 2b8730f997..028855fd03 100644 --- a/src/pyj/read_book/settings.pyj +++ b/src/pyj/read_book/settings.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal +from __python__ import hash_literals opts = {} diff --git a/src/pyj/read_book/ui.pyj b/src/pyj/read_book/ui.pyj index a43181c986..d7989331e4 100644 --- a/src/pyj/read_book/ui.pyj +++ b/src/pyj/read_book/ui.pyj @@ -1,6 +1,7 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal # globals: __RENDER_VERSION__ +from __python__ import hash_literals import traceback from ajax import ajax, encode_query diff --git a/src/pyj/read_book/view.pyj b/src/pyj/read_book/view.pyj index 3233c0df8c..5ff0ed0bda 100644 --- a/src/pyj/read_book/view.pyj +++ b/src/pyj/read_book/view.pyj @@ -1,7 +1,7 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2016, Kovid Goyal +from __python__ import bound_methods, hash_literals -from __python__ import bound_methods from book_list.globals import get_session_data from elementmaker import E from gettext import gettext as _ diff --git a/src/pyj/session.pyj b/src/pyj/session.pyj index e3e244632c..7738eaa945 100644 --- a/src/pyj/session.pyj +++ b/src/pyj/session.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2015, Kovid Goyal +from __python__ import hash_literals from ajax import ajax_send diff --git a/src/pyj/srv.pyj b/src/pyj/srv.pyj index 05849505b0..27610183de 100644 --- a/src/pyj/srv.pyj +++ b/src/pyj/srv.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2015, Kovid Goyal +from __python__ import hash_literals import initialize # noqa: unused-import from ajax import ajax diff --git a/src/pyj/utils.pyj b/src/pyj/utils.pyj index 549d52a7b9..891fc7961f 100644 --- a/src/pyj/utils.pyj +++ b/src/pyj/utils.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2015, Kovid Goyal +from __python__ import hash_literals def debounce(func, wait, immediate=False): # Returns a function, that, as long as it continues to be invoked, will not diff --git a/src/pyj/widgets.pyj b/src/pyj/widgets.pyj index d0624444e4..fb473d7851 100644 --- a/src/pyj/widgets.pyj +++ b/src/pyj/widgets.pyj @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2015, Kovid Goyal +from __python__ import hash_literals from dom import build_rule, clear, svgicon, create_keyframes from elementmaker import E