mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Sync to trunk
This commit is contained in:
commit
fae7bf3504
@ -77,6 +77,8 @@ def check_links(opf_path, pretty_print):
|
|||||||
html_files.append(os.path.abspath(content(f)))
|
html_files.append(os.path.abspath(content(f)))
|
||||||
|
|
||||||
for path in html_files:
|
for path in html_files:
|
||||||
|
if not os.access(path, os.R_OK):
|
||||||
|
continue
|
||||||
base = os.path.dirname(path)
|
base = os.path.dirname(path)
|
||||||
root = html.fromstring(open(content(path), 'rb').read(), parser=parser)
|
root = html.fromstring(open(content(path), 'rb').read(), parser=parser)
|
||||||
for element, attribute, link, pos in list(root.iterlinks()):
|
for element, attribute, link, pos in list(root.iterlinks()):
|
||||||
|
@ -249,7 +249,7 @@ class MetaInformation(object):
|
|||||||
ans = u''
|
ans = u''
|
||||||
ans += u'Title : ' + unicode(self.title) + u'\n'
|
ans += u'Title : ' + unicode(self.title) + u'\n'
|
||||||
if self.authors:
|
if self.authors:
|
||||||
ans += u'Author : ' + (', '.join(self.authors) if self.authors is not None else u'None')
|
ans += u'Author : ' + (' & '.join(self.authors) if self.authors is not None else _('Unknown'))
|
||||||
ans += ((' [' + self.author_sort + ']') if self.author_sort else '') + u'\n'
|
ans += ((' [' + self.author_sort + ']') if self.author_sort else '') + u'\n'
|
||||||
if self.publisher:
|
if self.publisher:
|
||||||
ans += u'Publisher: '+ unicode(self.publisher) + u'\n'
|
ans += u'Publisher: '+ unicode(self.publisher) + u'\n'
|
||||||
|
@ -33,7 +33,7 @@ class EXTHHeader(object):
|
|||||||
self.length, self.num_items = struct.unpack('>LL', raw[4:12])
|
self.length, self.num_items = struct.unpack('>LL', raw[4:12])
|
||||||
raw = raw[12:]
|
raw = raw[12:]
|
||||||
pos = 0
|
pos = 0
|
||||||
self.mi = MetaInformation('Unknown', ['Unknown'])
|
self.mi = MetaInformation(_('Unknown'), [_('Unknown')])
|
||||||
self.has_fake_cover = True
|
self.has_fake_cover = True
|
||||||
|
|
||||||
for i in range(self.num_items):
|
for i in range(self.num_items):
|
||||||
@ -63,7 +63,9 @@ class EXTHHeader(object):
|
|||||||
|
|
||||||
def process_metadata(self, id, content, codec):
|
def process_metadata(self, id, content, codec):
|
||||||
if id == 100:
|
if id == 100:
|
||||||
self.mi.authors = [content.decode(codec, 'ignore').strip()]
|
if self.mi.authors == [_('Unknown')]:
|
||||||
|
self.mi.authors = []
|
||||||
|
self.mi.authors.append(content.decode(codec, 'ignore').strip())
|
||||||
elif id == 101:
|
elif id == 101:
|
||||||
self.mi.publisher = content.decode(codec, 'ignore').strip()
|
self.mi.publisher = content.decode(codec, 'ignore').strip()
|
||||||
elif id == 103:
|
elif id == 103:
|
||||||
|
@ -28,9 +28,6 @@
|
|||||||
<property name="readOnly" >
|
<property name="readOnly" >
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumBlockCount" >
|
|
||||||
<number>400</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -102,7 +102,7 @@ Device Integration
|
|||||||
|
|
||||||
What devices does |app| support?
|
What devices does |app| support?
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
At the moment |app| has full support for the SONY PRS 500/505/700 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 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?
|
I used |app| to transfer some books to my reader, and now the SONY software hangs every time I connect the reader?
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -286,7 +286,7 @@ def write(socket, msg, timeout=5):
|
|||||||
def read(socket, timeout=5):
|
def read(socket, timeout=5):
|
||||||
'''
|
'''
|
||||||
Read a message from `socket`. The message must have been sent with the :function:`write`
|
Read a message from `socket`. The message must have been sent with the :function:`write`
|
||||||
function. Raises a `RuntimeError` if the message is corrpted. Can return an
|
function. Raises a `RuntimeError` if the message is corrupted. Can return an
|
||||||
empty string.
|
empty string.
|
||||||
'''
|
'''
|
||||||
if isworker:
|
if isworker:
|
||||||
@ -299,7 +299,12 @@ def read(socket, timeout=5):
|
|||||||
if not msg:
|
if not msg:
|
||||||
break
|
break
|
||||||
if length is None:
|
if length is None:
|
||||||
length, msg = int(msg[:12]), msg[12:]
|
try:
|
||||||
|
length, msg = int(msg[:12]), msg[12:]
|
||||||
|
except ValueError:
|
||||||
|
if DEBUG:
|
||||||
|
print >>sys.__stdout__, 'read(%s):'%('worker' if isworker else 'overseer'), 'no length in', msg
|
||||||
|
return ''
|
||||||
buf.write(msg)
|
buf.write(msg)
|
||||||
if buf.tell() >= length:
|
if buf.tell() >= length:
|
||||||
break
|
break
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user