More miscellaneous fixes

This commit is contained in:
Kovid Goyal 2009-04-25 12:22:39 -07:00
parent 19e7ed0cb7
commit e80fcc13fc
3 changed files with 10 additions and 3 deletions

View File

@ -941,7 +941,10 @@ class Manifest(object):
href = urlunparse(purl)
path, frag = urldefrag(href)
if not path:
if frag:
return '#'.join((self.href, frag))
else:
return self.href
if '/' not in self.href:
return href
dirname = os.path.dirname(self.href)

View File

@ -102,6 +102,7 @@ class DetectStructure(object):
play_order=self.oeb.toc.next_play_order())
def elem_to_link(self, item, elem, counter):
text = u' '.join([t.strip() for t in elem.xpath('descendant::text()')])
text = text[:100].strip()

View File

@ -158,6 +158,9 @@ class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog):
def set_cover(self):
row = self.formats.currentRow()
fmt = self.formats.item(row)
if fmt is None:
if self.formats.count() == 1:
fmt = self.formats.item(0)
if fmt is None:
error_dialog(self, _('No format selected'),
_('No format selected')).exec_()