sync with Kovid's branch

This commit is contained in:
Tomasz Długosz 2013-03-22 21:24:51 +01:00
commit d19976ad11
6 changed files with 670 additions and 397 deletions

View File

@ -19,6 +19,62 @@
# new recipes:
# - title:
- version: 0.9.24
date: 2013-03-22
new features:
- title: "ToC Editor: Allow auto-generation of Table of Contents entries from headings and/or links in the book"
- title: "EPUB/MOBI Catalogs: Allow saving used settings as presets which can be loaded easily later."
tickets: [1155587]
- title: "Indicate which columns are custom columns when selecting columns in the Preferences"
tickets: [1158066]
- title: "News download: Add an option recipe authors can set to have calibre automatically reduce the size of downloaded images by lowering their quality"
bug fixes:
- title: "News download: Fix a regression in 0.9.23 that prevented oldest_article from working with some RSS feeds."
- title: "Conversion: handle the :before and :after pseudo CSS selectors correctly"
- title: "AZW3 Output: Handle the case of the <guide> reference to a ToC containing an anchor correctly."
tickets: [1158413]
- title: "BiBTeX catalogs: Fix ISBN not being output and the library_name field causing catalog generation to fail"
tickets: [1156432, 1158127]
- title: "Conversion: Add support for CSS stylesheets that wrap their rules inside a @media rule."
tickets: [1157345]
- title: "Cover browser: Fix scrolling not working for books after the 32678'th book in a large library."
tickets: [1153204]
- title: "Linux: Update bundled libmtp version"
- title: "Clear the Book details panel when the current search returns no matches."
tickets: [1153026]
- title: "Fix a regression that broke creation of advanced column coloring rules"
tickets: [1156291]
- title: "Amazon metadata download: Handle cover images loaded via javascript on the amazon.de site"
- title: "Nicer error message when exporting a generated csv catalog to a file open in another program on windows."
tickets: [1155539]
- title: "Fix ebook-convert -h showing ANSI escape codes in the windows command prompt"
tickets: [1158499]
improved recipes:
- Various Polish news sources
- kath.net
- Il Giornale
- Kellog Insight
new recipes:
- title:
- version: 0.9.23
date: 2013-03-15

View File

@ -4,7 +4,7 @@ __license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'
__appname__ = u'calibre'
numeric_version = (0, 9, 23)
numeric_version = (0, 9, 24)
__version__ = u'.'.join(map(unicode, numeric_version))
__author__ = u"Kovid Goyal <kovid@kovidgoyal.net>"

View File

@ -420,9 +420,9 @@ class WAYTEQ(USBMS):
# Ordered list of supported formats
FORMATS = ['epub', 'mobi', 'prc', 'fb2', 'txt', 'pdf', 'html', 'rtf', 'chm', 'djvu', 'doc']
VENDOR_ID = [0x05e3, 0x0c45]
PRODUCT_ID = [0x0726, 0x0184]
BCD = [0x0222, 0x0100]
VENDOR_ID = [0x05e3, 0x05e8]
PRODUCT_ID = [0x0726, 0x0728]
BCD = [0x0222]
EBOOK_DIR_MAIN = 'Documents'
SCAN_FROM_ROOT = True
@ -433,7 +433,7 @@ class WAYTEQ(USBMS):
def get_gui_name(self):
try:
if self.detected_device.idVendor == 0x0c45:
if self.detected_device.idVendor == 0x05e8:
return 'SPC Dickens'
except Exception:
pass

View File

@ -12,7 +12,6 @@ from optparse import OptionGroup, Option
from calibre.utils.config import OptionParser
from calibre.utils.logging import Log
from calibre.constants import preferred_encoding
from calibre.customize.conversion import OptionRecommendation
from calibre import patheq
from calibre.ebooks.conversion import ConversionUserFeedBack
@ -53,8 +52,7 @@ HEURISTIC_OPTIONS = ['markup_chapter_headings',
DEFAULT_TRUE_OPTIONS = HEURISTIC_OPTIONS + ['remove_fake_margins']
def print_help(parser, log):
help = parser.format_help().encode(preferred_encoding, 'replace')
log(help)
parser.print_help()
def check_command_line_options(parser, args, log):
if len(args) < 3 or args[1].startswith('-') or args[2].startswith('-'):

View File

@ -126,6 +126,7 @@ class ItemView(QFrame): # {{{
go_to_root = pyqtSignal()
create_from_xpath = pyqtSignal(object)
create_from_links = pyqtSignal()
flatten_toc = pyqtSignal()
def __init__(self, parent):
QFrame.__init__(self, parent)
@ -189,6 +190,13 @@ class ItemView(QFrame): # {{{
)))
l.addWidget(b)
self.fal = b = QPushButton(_('Flatten the ToC'))
b.clicked.connect(self.flatten_toc)
b.setToolTip(textwrap.fill(_(
'Flatten the Table of Contents, putting all entries at the top level'
)))
l.addWidget(b)
l.addStretch()
self.w1 = la = QLabel(_('<b>WARNING:</b> calibre only supports the '
@ -388,6 +396,7 @@ class TOCView(QWidget): # {{{
i.create_from_xpath.connect(self.create_from_xpath)
i.create_from_links.connect(self.create_from_links)
i.flatten_item.connect(self.flatten_item)
i.flatten_toc.connect(self.flatten_toc)
i.go_to_root.connect(self.go_to_root)
l.addWidget(i, 0, 4, col, 1)
@ -413,8 +422,29 @@ class TOCView(QWidget): # {{{
p = item.parent() or self.root
p.removeChild(item)
def iteritems(self, parent=None):
if parent is None:
parent = self.root
for i in xrange(parent.childCount()):
child = parent.child(i)
yield child
for gc in self.iteritems(parent=child):
yield gc
def flatten_toc(self):
found = True
while found:
found = False
for item in self.iteritems():
if item.childCount() > 0:
self._flatten_item(item)
found = True
break
def flatten_item(self):
item = self.tocw.currentItem()
self._flatten_item(self.tocw.currentItem())
def _flatten_item(self, item):
if item is not None:
p = item.parent() or self.root
idx = p.indexOfChild(item)

File diff suppressed because it is too large Load Diff