From 901af7414a0193bde3e9dadafe31bd656e50272e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 5 Sep 2009 08:40:11 -0600 Subject: [PATCH 1/4] Fix bug causing the calibre server to open files in read-write mode instead of read-only --- src/calibre/library/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/library/server.py b/src/calibre/library/server.py index 8e108ef923..b3ddd0110b 100644 --- a/src/calibre/library/server.py +++ b/src/calibre/library/server.py @@ -309,7 +309,7 @@ class LibraryServer(object): def get_format(self, id, format): format = format.upper() fmt = self.db.format(id, format, index_is_id=True, as_file=True, - mode='r+b') + mode='rb') if fmt is None: raise cherrypy.HTTPError(404, 'book: %d does not have format: %s'%(id, format)) if format == 'EPUB': From e144a04d7b0f740d687ca7fd109a187610d4e330 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 5 Sep 2009 08:44:12 -0600 Subject: [PATCH 2/4] IGN:Fix convert existing feature --- src/calibre/gui2/tools.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/calibre/gui2/tools.py b/src/calibre/gui2/tools.py index 7e1655b425..5670031e68 100644 --- a/src/calibre/gui2/tools.py +++ b/src/calibre/gui2/tools.py @@ -198,10 +198,11 @@ def convert_existing(parent, db, book_ids, output_format): already_converted_ids.append(book_id) already_converted_titles.append(db.get_metadata(book_id, True).title) - if not question_dialog(parent, _('Convert existing'), - _('The following books have already been converted to %s format. ' - 'Do you wish to reconvert them?') % output_format, - '\n'.join(already_converted_titles)): - book_ids = [x for x in book_ids if x not in already_converted_ids] + if already_converted_ids: + if not question_dialog(parent, _('Convert existing'), + _('The following books have already been converted to %s format. ' + 'Do you wish to reconvert them?') % output_format, + '\n'.join(already_converted_titles)): + book_ids = [x for x in book_ids if x not in already_converted_ids] return book_ids From f607124d30d23359d056542bd08d6602a77f0105 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 5 Sep 2009 08:49:31 -0600 Subject: [PATCH 3/4] Ebook viewer: j/k keys scroll by a small amount again --- src/calibre/gui2/viewer/documentview.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/calibre/gui2/viewer/documentview.py b/src/calibre/gui2/viewer/documentview.py index 3cda941be6..b8dcbb8a7f 100644 --- a/src/calibre/gui2/viewer/documentview.py +++ b/src/calibre/gui2/viewer/documentview.py @@ -541,11 +541,6 @@ class DocumentView(QWebView): if self.manager is not None: self.manager.scrolled(self.scroll_fraction) - def wheel_event(self, down=True): - QWebView.wheelEvent(self, - QWheelEvent(QPoint(100, 100), (-120 if down else 120), - Qt.NoButton, Qt.NoModifier)) - def next_page(self): delta_y = self.document.window_height - 25 if self.document.at_bottom: @@ -654,9 +649,9 @@ class DocumentView(QWebView): else: self.scroll_to(1) elif key in [Qt.Key_J]: - self.wheel_event() + self.scroll_by(y=15) elif key in [Qt.Key_K]: - self.wheel_event(down=False) + self.scroll_by(y=-15) elif key in [Qt.Key_H]: self.scroll_by(x=-15) elif key in [Qt.Key_L]: From c690bca24aa942fcf0c6eeaf97f7dbac45ddce72 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 5 Sep 2009 09:01:54 -0600 Subject: [PATCH 4/4] IGN:Use launchpad branch to merge updated translations --- setup.py | 3 ++- upload.py | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2d562ce73e..d8072af50d 100644 --- a/setup.py +++ b/setup.py @@ -72,7 +72,7 @@ if __name__ == '__main__': build_osx, upload_installers, upload_user_manual, \ upload_to_pypi, stage3, stage2, stage1, upload, \ upload_rss, betas, build_linux32, build_linux64, \ - build_osx64 + build_osx64, get_translations resources.SCRIPTS = {} for x in ('console', 'gui'): for name in basenames[x]: @@ -265,6 +265,7 @@ if __name__ == '__main__': 'manual' : manual, 'resources' : resources, 'translations' : translations, + 'get_translations': get_translations, 'gui' : gui, 'clean' : clean, 'sdist' : sdist, diff --git a/upload.py b/upload.py index 9574c633b3..76d101013e 100644 --- a/upload.py +++ b/upload.py @@ -281,6 +281,32 @@ class translations(OptionlessCommand): if os.path.exists(path): os.remove(path) +class get_translations(translations): + + description = 'Get updated translations from Launchpad' + BRANCH = 'lp:~kovid/calibre/translations' + + def run(self): + cwd = os.getcwd() + subprocess.check_call(['bzr', 'merge', self.BRANCH]) + + def check_for_errors(self): + errors = os.path.join(self.PATH, '.errors') + if os.path.exists(errors): + shutil.rmtree(errors) + pofilter = ('pofilter', '-i', '.', '-o', errors, + '-t', 'accelerators', '-t', 'escapes', '-t', 'variables', + #'-t', 'xmltags', + '-t', 'printf') + subprocess.check_call(pofilter) + errs = os.listdir(errors) + if errs: + print 'WARNING: Translation errors detected' + print 'See http://translate.sourceforge.net/wiki/toolkit/using_pofilter' + print 'Error files:\n' + for e in errs: + print os.path.join(errors, e) + class gui(OptionlessCommand): description='''Compile all GUI forms and images'''