mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:Misc. minor fixes. Also inset <mbp:section> tags around the content of every individual file when it is merged into the MOBI stream
This commit is contained in:
parent
01b1a28392
commit
a40d47956f
@ -112,7 +112,7 @@ class PRS505(Device):
|
||||
if not os.access(ioreg, os.X_OK):
|
||||
ioreg = 'ioreg'
|
||||
raw = subprocess.Popen((ioreg+' -w 0 -S -c IOMedia').split(),
|
||||
stdout=subprocess.PIPE).stdout.read()
|
||||
stdout=subprocess.PIPE).communicate()[0]
|
||||
lines = raw.splitlines()
|
||||
names = {}
|
||||
for i, line in enumerate(lines):
|
||||
|
@ -200,7 +200,7 @@ class Device(_Device):
|
||||
if not os.access(ioreg, os.X_OK):
|
||||
ioreg = 'ioreg'
|
||||
raw = subprocess.Popen((ioreg+' -w 0 -S -c IOMedia').split(),
|
||||
stdout=subprocess.PIPE).stdout.read()
|
||||
stdout=subprocess.PIPE).communicate()[0]
|
||||
lines = raw.splitlines()
|
||||
names = {}
|
||||
|
||||
|
@ -211,12 +211,13 @@ class Serializer(object):
|
||||
|
||||
def serialize_item(self, item):
|
||||
buffer = self.buffer
|
||||
buffer.write('<mbp:section>')
|
||||
if not item.linear:
|
||||
self.breaks.append(buffer.tell() - 1)
|
||||
self.id_offsets[item.href] = buffer.tell()
|
||||
for elem in item.data.find(XHTML('body')):
|
||||
self.serialize_elem(elem, item)
|
||||
buffer.write('<mbp:pagebreak/>')
|
||||
buffer.write('</mbp:section></mbp:pagebreak>')
|
||||
|
||||
def serialize_elem(self, elem, item, nsrmap=NSRMAP):
|
||||
buffer = self.buffer
|
||||
|
@ -93,7 +93,7 @@ class DateDelegate(QStyledItemDelegate):
|
||||
|
||||
def createEditor(self, parent, option, index):
|
||||
qde = QStyledItemDelegate.createEditor(self, parent, option, index)
|
||||
qde.setDisplayFormat('MM/dd/yyyy')
|
||||
qde.setDisplayFormat(unicode(qde.displayFormat()).replace('yy', 'yyyy'))
|
||||
qde.setMinimumDate(QDate(101,1,1))
|
||||
qde.setCalendarPopup(True)
|
||||
return qde
|
||||
@ -635,7 +635,8 @@ class BooksView(TableView):
|
||||
|
||||
def columns_sorted(self, rating_col, timestamp_col):
|
||||
for i in range(self.model().columnCount(None)):
|
||||
if self.itemDelegateForColumn(i) == self.rating_delegate:
|
||||
if self.itemDelegateForColumn(i) in (self.rating_delegate,
|
||||
self.timestamp_delegate):
|
||||
self.setItemDelegateForColumn(i, self.itemDelegate())
|
||||
if rating_col > -1:
|
||||
self.setItemDelegateForColumn(rating_col, self.rating_delegate)
|
||||
|
@ -226,7 +226,11 @@ class ResultCache(SearchQueryParser):
|
||||
Returns a list of affected rows or None if the rows are filtered.
|
||||
'''
|
||||
for id in ids:
|
||||
self._data[id] = conn.get('SELECT * from meta WHERE id=?', (id,))[0]
|
||||
try:
|
||||
self._data[id] = conn.get('SELECT * from meta WHERE id=?',
|
||||
(id,))[0]
|
||||
except IndexError:
|
||||
return None
|
||||
try:
|
||||
return map(self.row, ids)
|
||||
except ValueError:
|
||||
|
@ -128,7 +128,7 @@ def get_extra_content(site, sfeeds_ids, ctx):
|
||||
def get_posts_tags(object_list, sfeeds_obj, user_id, tag_name):
|
||||
""" Adds a qtags property in every post object in a page.
|
||||
|
||||
Use "qtags" instead of "tags" in templates to avoid innecesary DB hits.
|
||||
Use "qtags" instead of "tags" in templates to avoid unnecessary DB hits.
|
||||
"""
|
||||
tagd = {}
|
||||
user_obj = None
|
||||
|
Loading…
x
Reference in New Issue
Block a user