Merge from trunk

This commit is contained in:
Charles Haley 2010-09-11 09:52:28 +01:00
commit ddd67dbd49
38 changed files with 41115 additions and 31110 deletions

View File

@ -4,6 +4,83 @@
# for important features/bug fixes.
# Also, each release can have new and improved recipes.
- version: 0.7.18
date: 2010-09-10
new features:
- title: "All new Preferences dialog, with nicer layout and the ability to restore settings to defaults"
type: major
- title: "Add series info when available to generated cover. Also auto-resize the logo on the cover to ensure all text fits"
tickets: [6724]
- title: "On device column: Now indicates when multiple copies of the same book are present on the device"
- title: "Driver for the Gemei GM2000"
- title: "Extract fb2 files from zip container when adding to calibre. Can be disables by disabling the Archive Extract file type plugin."
tickets: [6739]
- title: "Switch to using raster icons for a small speedup in startup time"
bug fixes:
- title: "On device column: Fix matching bug when multiple books in the library have the same title and author"
- title: "Content server: Use /mobile version for Kindle browser"
- title: "E-book viewer: When adding a bookmark, a default name is generated"
tickets: [6450]
- title: "Hide visible menus before clearing toolbar."
tickets: [6706]
- title: "Batch conversion: Don't overwrite the insert page break before setting"
tickets: [6729]
- title: "Catalog generation: Fixed improper title display in catalog when title contains ':'. Added 'ondevice' field to CSV/XML catalog output (only with connected device|folder|iTunes). Added optional 'Series' section to generated catalogs with hyperlinks between books and series. Tweaks to catalog formatting."
- title: "Fix regression when checking database integrity with custom columns introduced in 0.7.17"
- title: "Sending email: Ignore geenric records when trying to resolve domain"
tickets: [6723]
- title: "Fix a bug where the open state of the splitter was not being saved on shutdown if the splitter had been closed at startup and was opened by dragging the center line"
- title: "MOBI Output: Fix bug generating index when chapter names contained non ASCII characters"
tickets: [6595]
- title: "PDF Input: Fix handling of more non ascii characters"
- title: "Content server: Triple AJAX timeout for main book list to 30 seconds"
- title: "Use ImageMagick instead of Qt to generate thumbnails when sending covers to device. Should fix corrupted nook covers on some windows installs"
- title: "FB2 Output: Improve creation of sections and fix a couple of bugs that could result in invalid output"
new recipes:
- title: "Journal Gazette"
author: cynvision
- title: "Milenio"
author: bmsleight
- title: "Winnipeg Free Press"
author: buyo
- title: "Buckmasters in the kitchen, The Walrus Magazine and Kansas City Star"
author: Tony Stegall
- title: "Europa Sur"
author: "Darko Miletic"
improved recipes:
- El Pais
- La Jornada
- nrcnext
- WSJ (free)
- version: 0.7.17
date: 2010-09-03

View File

@ -2,7 +2,7 @@ __license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'
__appname__ = 'calibre'
__version__ = '0.7.17'
__version__ = '0.7.18'
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
import re

View File

@ -44,16 +44,17 @@ class Book(MetaInformation):
self.mime = mime
self.size = size # will be set later if None
try:
if ContentType == '6':
self.datetime = time.strptime(date, "%Y-%m-%dT%H:%M:%S.%f")
else:
self.datetime = time.gmtime(os.path.getctime(self.path))
except:
self.datetime = time.gmtime()
if thumbnail_name is not None:
self.thumbnail = ImageWrapper(thumbnail_name)
if ContentType == '6':
self.datetime = time.strptime(date, "%Y-%m-%dT%H:%M:%S.%f")
else:
try:
self.datetime = time.gmtime(os.path.getctime(self.path))
except:
self.datetime = time.gmtime()
if thumbnail_name is not None:
self.thumbnail = ImageWrapper(thumbnail_name)
self.tags = []
if other:
self.smart_update(other)

View File

@ -106,11 +106,14 @@ class KOBO(USBMS):
changed = True
bl[idx].device_collections = playlist_map.get(lpath, [])
else:
book = self.book_from_path(prefix, lpath, title, authors, mime, date, ContentType, ImageID)
if ContentType == '6':
book = Book(prefix, lpath, title, authors, mime, date, ContentType, ImageID, size=1048576)
else:
book = self.book_from_path(prefix, lpath, title, authors, mime, date, ContentType, ImageID)
# print 'Update booklist'
book.device_collections = playlist_map.get(book.lpath, [])
if bl.add_book(book, replace_metadata=False):
changed = True
book.device_collections = playlist_map.get(book.lpath, [])
except: # Probably a path encoding error
import traceback
traceback.print_exc()
@ -231,21 +234,9 @@ class KOBO(USBMS):
path = self.normalize_path(path)
# print "Delete file normalized path: " + path
extension = os.path.splitext(path)[1]
if extension == '.kobo':
# Kobo books do not have book files. They do have some images though
#print "kobo book"
ContentType = 6
ContentID = self.contentid_from_path(path, ContentType)
elif extension == '.pdf' or extension == '.epub':
# print "ePub or pdf"
ContentType = 16
#print "Path: " + path
ContentID = self.contentid_from_path(path, ContentType)
# print "ContentID: " + ContentID
else: # if extension == '.html' or extension == '.txt':
ContentType = 999 # Yet another hack: to get around Kobo changing how ContentID is stored
ContentID = self.contentid_from_path(path, ContentType)
ContentType = self.get_content_type_from_extension(extension)
ContentID = self.contentid_from_path(path, ContentType)
ImageID = self.delete_via_sql(ContentID, ContentType)
#print " We would now delete the Images for" + ImageID
@ -343,6 +334,17 @@ class KOBO(USBMS):
ContentID = ContentID.replace("\\", '/')
return ContentID
def get_content_type_from_extension(self, extension):
if extension == '.kobo':
# Kobo books do not have book files. They do have some images though
#print "kobo book"
ContentType = 6
elif extension == '.pdf' or extension == '.epub':
# print "ePub or pdf"
ContentType = 16
else: # if extension == '.html' or extension == '.txt':
ContentType = 999 # Yet another hack: to get around Kobo changing how ContentID is stored
return ContentType
def path_from_contentid(self, ContentID, ContentType, oncard):
path = ContentID

View File

@ -89,6 +89,10 @@ class XMLCache(object):
raw, strip_encoding_pats=True, assume_utf8=True,
verbose=DEBUG)[0],
parser=parser)
if self.roots[source_id] is None:
raise Exception(('The SONY database at %s is corrupted. Try '
' disconnecting and reconnecting your reader.')%path)
# }}}
recs = self.roots[0].xpath('//*[local-name()="records"]')

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

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

View File

@ -55,6 +55,9 @@ def shorten_components_to(length, components):
else:
if x is components[-1]:
b, _, e = x.rpartition('.')
if not b and e:
b = e
e = ''
r = b[:-delta]+e
if r.startswith('.'): r = x[0]+r
else: