From 69261e96f577f2a9141f369957d2a97a79ddbde1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 22 Mar 2021 11:25:02 +0530 Subject: [PATCH] Browser viewer: Fix Go to Location not working for positions. Fixes #1920250 [[Content server viewer] Error when trying to go to position in book](https://bugs.launchpad.net/calibre/+bug/1920250) --- src/pyj/read_book/goto.pyj | 3 ++- src/pyj/read_book/ui.pyj | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pyj/read_book/goto.pyj b/src/pyj/read_book/goto.pyj index df4630363a..9bec35e01f 100644 --- a/src/pyj/read_book/goto.pyj +++ b/src/pyj/read_book/goto.pyj @@ -2,6 +2,7 @@ # License: GPL v3 Copyright: 2016, Kovid Goyal from __python__ import bound_methods, hash_literals +import traceback from elementmaker import E from gettext import gettext as _ @@ -125,7 +126,7 @@ def create_location_overlay(current_position_data, book, overlay, container): ui_operations.goto_book_position(float(src)) except: error_dialog(_('Not a valid book position'), _( - '{} is not a valid book position').format(src)) + '{} is not a valid book position').format(src), traceback.format_exc()) else: overlay.hide() diff --git a/src/pyj/read_book/ui.pyj b/src/pyj/read_book/ui.pyj index 962ba398c8..cfc2b21692 100644 --- a/src/pyj/read_book/ui.pyj +++ b/src/pyj/read_book/ui.pyj @@ -72,7 +72,7 @@ class ReadUI: ui_operations.goto_cfi = self.goto_cfi.bind(self) ui_operations.goto_frac = self.goto_frac.bind(self) ui_operations.goto_book_position = self.goto_book_position.bind(self) - ui_operations.goto_book_position = self.goto_reference.bind(self) + ui_operations.goto_reference = self.goto_reference.bind(self) ui_operations.delete_book = self.delete_book.bind(self) ui_operations.focus_iframe = self.focus_iframe.bind(self) ui_operations.toggle_toc = self.toggle_toc.bind(self)