diff --git a/src/calibre/constants.py b/src/calibre/constants.py index e6f9b771e9..ef83336740 100644 --- a/src/calibre/constants.py +++ b/src/calibre/constants.py @@ -2,7 +2,7 @@ __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' __appname__ = 'calibre' -__version__ = '0.4.139' +__version__ = '0.4.140' __author__ = "Kovid Goyal " ''' Various run time constants. diff --git a/src/calibre/devices/__init__.py b/src/calibre/devices/__init__.py index ebb95a4e86..ed16dba14b 100644 --- a/src/calibre/devices/__init__.py +++ b/src/calibre/devices/__init__.py @@ -11,7 +11,8 @@ def devices(): from calibre.devices.prs700.driver import PRS700 from calibre.devices.cybookg3.driver import CYBOOKG3 from calibre.devices.kindle.driver import KINDLE - return (PRS500, PRS505, PRS700, CYBOOKG3, KINDLE) + from calibre.devices.kindle.driver import KINDLE2 + return (PRS500, PRS505, PRS700, CYBOOKG3, KINDLE, KINDLE2) import time diff --git a/src/calibre/devices/kindle/driver.py b/src/calibre/devices/kindle/driver.py index f9f87028ae..e35d5f8cd3 100755 --- a/src/calibre/devices/kindle/driver.py +++ b/src/calibre/devices/kindle/driver.py @@ -4,7 +4,7 @@ __copyright__ = '2009, John Schember ' Device driver for Amazon's Kindle ''' -import os, fnmatch +import os from calibre.devices.usbms.driver import USBMS @@ -35,10 +35,13 @@ class KINDLE(USBMS): if os.path.exists(path): os.unlink(path) - filepath, ext = os.path.splitext(path) - basepath, filename = os.path.split(filepath) + filepath = os.path.splitext(path)[0] # Delete the ebook auxiliary file if os.path.exists(filepath + '.mbp'): os.unlink(filepath + '.mbp') +class KINDLE2(KINDLE): + + PRODUCT_ID = [0x0002] + BCD = [0x0100] \ No newline at end of file diff --git a/src/calibre/gui2/viewer/main.py b/src/calibre/gui2/viewer/main.py index 6be7d9a9ae..ec0d878ae8 100644 --- a/src/calibre/gui2/viewer/main.py +++ b/src/calibre/gui2/viewer/main.py @@ -9,7 +9,7 @@ from PyQt4.Qt import QMovie, QApplication, Qt, QIcon, QTimer, QWidget, SIGNAL, \ QDesktopServices, QDoubleSpinBox, QLabel, QTextBrowser, \ QPainter, QBrush, QColor, QStandardItemModel, QPalette, \ QStandardItem, QUrl, QRegExpValidator, QRegExp, QLineEdit, \ - QToolButton, QMenu, QInputDialog + QToolButton, QMenu, QInputDialog, QAction from calibre.gui2.viewer.main_ui import Ui_EbookViewer from calibre.gui2.viewer.printing import Printing @@ -222,8 +222,14 @@ class EbookViewer(MainWindow, Ui_EbookViewer): self.view.set_manager(self) self.pi = ProgressIndicator(self) self.toc.setVisible(False) + self.action_quit = QAction(self) + self.addAction(self.action_quit) + self.action_quit.setShortcut(Qt.CTRL+Qt.Key_Q) + self.connect(self.action_quit, SIGNAL('triggered(bool)'), + lambda x:QApplication.instance().quit()) self.action_copy.setDisabled(True) self.action_metadata.setCheckable(True) + self.action_metadata.setShortcut(Qt.CTRL+Qt.Key_I) self.action_table_of_contents.setCheckable(True) self.action_reference_mode.setCheckable(True) self.connect(self.action_reference_mode, SIGNAL('triggered(bool)'), diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index 1e88a670f4..22266487e8 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -916,12 +916,18 @@ class LibraryDatabase2(LibraryDatabase): else: aid = self.conn.execute('INSERT INTO authors(name) VALUES (?)', (a,)).lastrowid try: - self.conn.execute('INSERT INTO books_authors_link(book, author) VALUES (?,?)', (id, aid)) + self.conn.execute('INSERT INTO books_authors_link(book, author) VALUES (?,?)', + (id, aid)) except IntegrityError: # Sometimes books specify the same author twice in their metadata pass + ss = authors_to_sort_string(authors) + self.conn.execute('UPDATE books SET author_sort=? WHERE id=?', + (ss, id)) self.conn.commit() - self.data.set(id, FIELD_MAP['authors'], ','.join([a.replace(',', '|') for a in authors]), row_is_id=True) - self.data.set(id, FIELD_MAP['author_sort'], self.data[self.data.row(id)][FIELD_MAP['authors']], row_is_id=True) + self.data.set(id, FIELD_MAP['authors'], + ','.join([a.replace(',', '|') for a in authors]), + row_is_id=True) + self.data.set(id, FIELD_MAP['author_sort'], ss, row_is_id=True) self.set_path(id, True) if notify: self.notify('metadata', [id]) diff --git a/src/calibre/manual/faq.rst b/src/calibre/manual/faq.rst index 7f31c8bf66..bb1eb9ba02 100644 --- a/src/calibre/manual/faq.rst +++ b/src/calibre/manual/faq.rst @@ -103,7 +103,7 @@ Device Integration What devices does |app| support? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -At the moment |app| has full support for the SONY PRS 500/505/700, Cybook Gen 3, Amazon Kindle as well as the iPhone. In addition, using the :guilabel:`Save to disk` function you can use it with any ebook reader that exports itself as a USB disk. +At the moment |app| has full support for the SONY PRS 500/505/700, Cybook Gen 3, Amazon Kindle 1 and 2 as well as the iPhone. In addition, using the :guilabel:`Save to disk` function you can use it with any ebook reader that exports itself as a USB disk. I used |app| to transfer some books to my reader, and now the SONY software hangs every time I connect the reader? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/src/calibre/web/feeds/recipes/recipe_new_york_review_of_books.py b/src/calibre/web/feeds/recipes/recipe_new_york_review_of_books.py index 872381b9a1..6846b64521 100644 --- a/src/calibre/web/feeds/recipes/recipe_new_york_review_of_books.py +++ b/src/calibre/web/feeds/recipes/recipe_new_york_review_of_books.py @@ -17,9 +17,19 @@ class NewYorkReviewOfBooks(BasicNewsRecipe): description = u'Book reviews' language = _('English') __author__ = 'Kovid Goyal' - + needs_subscription = True remove_tags_before = {'id':'container'} remove_tags = [{'class':['noprint', 'ad', 'footer']}, {'id':'right-content'}] + + def get_browser(self): + br = BasicNewsRecipe.get_browser() + if self.username is not None and self.password is not None: + br.open('http://www.nybooks.com/register/') + br.select_form(name='login') + br['email'] = self.username + br['password'] = self.password + br.submit() + return br def parse_index(self): root = html.fromstring(self.browser.open('http://www.nybooks.com/current-issue').read()) @@ -42,10 +52,4 @@ class NewYorkReviewOfBooks(BasicNewsRecipe): articles.append(article) return [('Current Issue', articles)] - - - - - - - \ No newline at end of file + diff --git a/src/calibre/web/feeds/recipes/recipe_new_yorker.py b/src/calibre/web/feeds/recipes/recipe_new_yorker.py index 6134ab03bc..cfd651e883 100644 --- a/src/calibre/web/feeds/recipes/recipe_new_yorker.py +++ b/src/calibre/web/feeds/recipes/recipe_new_yorker.py @@ -11,7 +11,7 @@ from calibre.web.feeds.news import BasicNewsRecipe class NewYorker(BasicNewsRecipe): title = u'The New Yorker' __author__ = 'Darko Miletic' - description = 'Best of the US journalism' + description = 'The best of US journalism' oldest_article = 7 language = _('English') max_articles_per_feed = 100