mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from trunk
This commit is contained in:
commit
6d07dc5850
102
Changelog.yaml
102
Changelog.yaml
@ -4,6 +4,108 @@
|
||||
# for important features/bug fixes.
|
||||
# Also, each release can have new and improved recipes.
|
||||
|
||||
- version: 0.7.30
|
||||
date: 2010-11-26
|
||||
|
||||
new features:
|
||||
- title: "Support for Acer Lumiread and PocketBook Pro 602"
|
||||
|
||||
- title: "When importing by ISBN also allow the specification of a file to be imported."
|
||||
tickets: [7400]
|
||||
|
||||
- title: "E-mail sending: Email sends are now regular jobs that can be accessed from the jobs list. Also when sending using gmail/hotmail send at most one email every five minutes to avoid trigerring their spam controls. Failed sends are now retried one more time, automatically."
|
||||
|
||||
- title: "Content server: When a category contains only one item, go directly to the book list instead of forcing the user to click on that one item"
|
||||
|
||||
- title: "E-mail sending: Allow unencrypted connections to SMTP relay"
|
||||
|
||||
- title: "Improve startup times for large libraries by caching the has_cover check"
|
||||
|
||||
- title: "Update windows binary build to use python 2.7"
|
||||
|
||||
- title: "Metadata and cover download plugins from Nicebooks (disabled by default)"
|
||||
|
||||
|
||||
bug fixes:
|
||||
- title: "MOBI Input: Fix bug in cleanup regex that broke parsing of escaped XML declarations."
|
||||
tickets: [7585]
|
||||
|
||||
- title: "Content server: Fix bug when user has custom categories/columns with non ascii names"
|
||||
tickets: [7590]
|
||||
|
||||
- title: "RTF Output: Handle non breaking spaces correctly"
|
||||
tickets: [7668]
|
||||
|
||||
- title: "Conversion pipeline: When rasterizing SVG images workaround incorrect handinlg of percentage height specifications in QSvgRenderer."
|
||||
tickets: [7598]
|
||||
|
||||
- title: "News download: Update version of feedparser used to parse RSS feeds."
|
||||
tickets: [7674]
|
||||
|
||||
- title: "Tag Browser: Allow user to restore hidden categories by a right click even is all categories have been hidden"
|
||||
|
||||
- title: "TXT/RTF Output: Handle XML processing instructions embedded in content correctly."
|
||||
tickets: [7644]
|
||||
|
||||
- title: "MOBI Input: Workarounds for lack of nesting rules between block and inline tags"
|
||||
tickets: [7618]
|
||||
|
||||
- title: "E-book viewer: Load all hyphenation patterns to support multi-lingual books"
|
||||
|
||||
- title: "E-book viewer: Fix incorrect lang names being used in hyphenation"
|
||||
|
||||
- title: "Check to see that the result file from a conversion is not empty before adding it, protects against the case where the conversion process crashes and the GUI adds a zero byte file to the book record"
|
||||
|
||||
- title: "E-book viewer: More sophisticated algorithm to resize images to fit viewer window. Should preserve aspect ratio in more cases"
|
||||
|
||||
- title: "Remove unneccessary calls to set_path when creating book records. Speeds up record creation by about 30% on my system"
|
||||
|
||||
- title: "Speedup for bibtex catalog generation."
|
||||
|
||||
- title: "Kobo driver: Fix missing table in deleting books process for Kobo WiFi and Kobo-O 1.8 Beta"
|
||||
|
||||
- title: "RTF Input: Preserve scene breaks in the form of empty paragraphs. Preprocessing: Improvements to chapter detection"
|
||||
|
||||
- title: "Fix custom recipe not sorted by title"
|
||||
tickets: [7486]
|
||||
|
||||
- title: "Kobo driver: Fix bug in managing the Im_Reading category on windows"
|
||||
|
||||
improved recipes:
|
||||
- "El Pais - Uruguay"
|
||||
- Argentinian La Nacion
|
||||
- comics.com
|
||||
- Mingpao
|
||||
- Revista Muy Intersante
|
||||
- Telepolis
|
||||
- New York Times
|
||||
|
||||
new recipes:
|
||||
- title: "Bangkok Biz News and Matichon"
|
||||
author: "Anat Ruangrassamee"
|
||||
|
||||
- title: "The Workingham Times and Deutsche Welle"
|
||||
author: "Darko Miletic"
|
||||
|
||||
- title: "Biz Portal"
|
||||
author: "marbs"
|
||||
|
||||
- title: "Various Japanese news sources"
|
||||
author: "Hiroshi Miura"
|
||||
|
||||
- title: "Arcamax"
|
||||
author: "Starson17"
|
||||
|
||||
- title: "Various Spanish news sources"
|
||||
author: "Gustavo Azambuja"
|
||||
|
||||
- title: "TSN"
|
||||
author: Nexus
|
||||
|
||||
- title: "Zeit Online Premium"
|
||||
author: Steffen Siebert
|
||||
|
||||
|
||||
- version: 0.7.29
|
||||
date: 2010-11-19
|
||||
|
||||
|
@ -632,6 +632,10 @@ def main(outfile, args=sys.argv[1:]):
|
||||
except tokenize.TokenError, e:
|
||||
print >> sys.stderr, '%s: %s, line %d, column %d' % (
|
||||
e[0], filename, e[1][0], e[1][1])
|
||||
except IndentationError, e:
|
||||
print >> sys.stderr, '%s: %s, line %s, column %s' % (
|
||||
e[0], filename, e.lineno, e[1][1])
|
||||
|
||||
finally:
|
||||
if closep:
|
||||
fp.close()
|
||||
|
@ -2,7 +2,7 @@ __license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
__appname__ = 'calibre'
|
||||
__version__ = '0.7.29'
|
||||
__version__ = '0.7.30'
|
||||
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
||||
|
||||
import re
|
||||
|
@ -475,7 +475,7 @@ class MobiReader(object):
|
||||
self.processed_html = self.processed_html.replace('\r\n', '\n')
|
||||
self.processed_html = self.processed_html.replace('> <', '>\n<')
|
||||
self.processed_html = self.processed_html.replace('<mbp: ', '<mbp:')
|
||||
self.processed_html = re.sub(r'<?xml[^>]*>', '', self.processed_html)
|
||||
self.processed_html = re.sub(r'<\?xml[^>]*>', '', self.processed_html)
|
||||
# Swap inline and block level elements, and order block level elements according to priority
|
||||
# - lxml and beautifulsoup expect/assume a specific order based on xhtml spec
|
||||
self.processed_html = re.sub(r'(?i)(?P<styletags>(<(h\d+|i|b|u|em|small|big|strong|tt)>\s*){1,})(?P<para><p[^>]*>)', '\g<para>'+'\g<styletags>', self.processed_html)
|
||||
|
@ -89,14 +89,18 @@ class AddAction(InterfaceAction):
|
||||
self.gui.library_view.model().db.import_book(MetaInformation(None), [])
|
||||
self.gui.library_view.model().books_added(num)
|
||||
|
||||
def add_isbns(self, isbns):
|
||||
def add_isbns(self, books):
|
||||
from calibre.ebooks.metadata import MetaInformation
|
||||
ids = set([])
|
||||
for x in isbns:
|
||||
for x in books:
|
||||
mi = MetaInformation(None)
|
||||
mi.isbn = x
|
||||
ids.add(self.gui.library_view.model().db.import_book(mi, []))
|
||||
self.gui.library_view.model().books_added(len(isbns))
|
||||
mi.isbn = x['isbn']
|
||||
db = self.gui.library_view.model().db
|
||||
if x['path'] is not None:
|
||||
ids.add(db.import_book(mi, [x['path']]))
|
||||
else:
|
||||
ids.add(db.import_book(mi, []))
|
||||
self.gui.library_view.model().books_added(len(books))
|
||||
self.gui.iactions['Edit Metadata'].do_download_metadata(ids)
|
||||
|
||||
|
||||
@ -150,7 +154,7 @@ class AddAction(InterfaceAction):
|
||||
from calibre.gui2.dialogs.add_from_isbn import AddFromISBN
|
||||
d = AddFromISBN(self.gui)
|
||||
if d.exec_() == d.Accepted:
|
||||
self.add_isbns(d.isbns)
|
||||
self.add_isbns(d.books)
|
||||
|
||||
def add_books(self, *args):
|
||||
'''
|
||||
|
@ -5,10 +5,13 @@ __license__ = 'GPL v3'
|
||||
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
import os
|
||||
|
||||
from PyQt4.Qt import QDialog, QApplication
|
||||
|
||||
from calibre.gui2.dialogs.add_from_isbn_ui import Ui_Dialog
|
||||
from calibre.ebooks.metadata import check_isbn
|
||||
from calibre.constants import iswindows
|
||||
|
||||
class AddFromISBN(QDialog, Ui_Dialog):
|
||||
|
||||
@ -16,7 +19,12 @@ class AddFromISBN(QDialog, Ui_Dialog):
|
||||
QDialog.__init__(self, parent)
|
||||
self.setupUi(self)
|
||||
|
||||
path = r'C:\Users\kovid\e-books\some_book.epub' if iswindows else \
|
||||
'/Users/kovid/e-books/some_book.epub'
|
||||
self.label.setText(unicode(self.label.text())%path)
|
||||
|
||||
self.isbns = []
|
||||
self.books = []
|
||||
self.paste_button.clicked.connect(self.paste)
|
||||
|
||||
def paste(self, *args):
|
||||
@ -30,11 +38,24 @@ class AddFromISBN(QDialog, Ui_Dialog):
|
||||
|
||||
def accept(self, *args):
|
||||
for line in unicode(self.isbn_box.toPlainText()).strip().splitlines():
|
||||
if line:
|
||||
isbn = check_isbn(line)
|
||||
line = line.strip()
|
||||
if not line:
|
||||
continue
|
||||
parts = line.split('>>')
|
||||
if len(parts) > 2:
|
||||
parts = [parts[0] + '>>'.join(parts[1:])]
|
||||
parts = [x.strip() for x in parts]
|
||||
if not parts[0]:
|
||||
continue
|
||||
isbn = check_isbn(parts[0])
|
||||
if isbn is not None:
|
||||
isbn = isbn.upper()
|
||||
if isbn not in self.isbns:
|
||||
self.isbns.append(isbn)
|
||||
book = {'isbn': isbn, 'path': None}
|
||||
if len(parts) > 1 and parts[1] and \
|
||||
os.access(parts[1], os.R_OK) and os.path.isfile(parts[1]):
|
||||
book['path'] = parts[1]
|
||||
self.books.append(book)
|
||||
QDialog.accept(self, *args)
|
||||
|
||||
|
@ -24,7 +24,10 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string><p>Enter a list of ISBNs in the box to the left, one per line. calibre will automatically create entries for books based on the ISBN and download metadata and covers for them.<p>Any invalid ISBNs in the list will be ignored.</string>
|
||||
<string><p>Enter a list of ISBNs in the box to the left, one per line. calibre will automatically create entries for books based on the ISBN and download metadata and covers for them.</p>
|
||||
<p>Any invalid ISBNs in the list will be ignored.</p>
|
||||
<p>You can also specify a file that will be added with each ISBN. To do this enter the full path to the file after a <code>>></code>. For example:</p>
|
||||
<p><code>9788842915232 >> %s</code></p></string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user