mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Minor modifications
This commit is contained in:
parent
a469a02ce7
commit
08eb0e1a59
@ -156,7 +156,7 @@ class Query(object):
|
||||
if feed is None:
|
||||
break
|
||||
entries.extend(entry(feed))
|
||||
return entries
|
||||
return entries[:nbresultstoget]
|
||||
|
||||
class ResultList(list):
|
||||
|
||||
@ -183,7 +183,7 @@ class ResultList(list):
|
||||
m = creator(entry)
|
||||
return [x.text for x in m] if m else []
|
||||
|
||||
def get_author_sort(self, entry, verbose):
|
||||
def get_author_sort(self, entry):
|
||||
for x in creator(entry):
|
||||
for key, val in x.attrib.iteritems():
|
||||
if key.endswith('file-as'):
|
||||
@ -216,6 +216,7 @@ class ResultList(list):
|
||||
try:
|
||||
return publisher(entry)[0].text
|
||||
except:
|
||||
report(verbose)
|
||||
return None
|
||||
|
||||
def get_date(self, entry, verbose):
|
||||
@ -241,7 +242,7 @@ class ResultList(list):
|
||||
print e
|
||||
authors = self.get_authors(x)
|
||||
mi = MetaInformation(title, authors)
|
||||
tmpautsort = self.get_author_sort(x, verbose)
|
||||
tmpautsort = self.get_author_sort(x)
|
||||
mi.author_sort = tmpautsort if tmpautsort \
|
||||
else authors_to_sort_string(authors)
|
||||
mi.comments = self.get_description(x, verbose)
|
||||
|
@ -203,7 +203,7 @@ class ResultList(list):
|
||||
|
||||
def get_description(self, entry, verbose):
|
||||
try:
|
||||
return u'RESUME:\n' + unicode(entry.getparent().xpath("//p[@id='book-description']")[0].text)
|
||||
return _(u'SUMMARY:\n%s') % unicode(entry.getparent().xpath("//p[@id='book-description']")[0].text)
|
||||
except:
|
||||
report(verbose)
|
||||
return None
|
||||
|
Loading…
x
Reference in New Issue
Block a user