mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Fix #356
This commit is contained in:
parent
4496ba5d89
commit
8bdcbf3058
@ -62,14 +62,14 @@ class MetaInformation(object):
|
||||
self.tags = []
|
||||
|
||||
def __str__(self):
|
||||
ans = ''
|
||||
ans += 'Title : ' + unicode(self.title) + '\n'
|
||||
ans += 'Author : ' + (', '.join(self.authors) if self.authors is not None else 'None')
|
||||
ans += ((' (' + self.author_sort + ')') if self.author_sort else '') + '\n'
|
||||
ans += 'Publisher: '+ unicode(self.publisher) + '\n'
|
||||
ans += 'Category : ' + unicode(self.category) + '\n'
|
||||
ans += 'Comments : ' + unicode(self.comments) + '\n'
|
||||
ans += 'ISBN : ' + unicode(self.isbn) + '\n'
|
||||
ans = u''
|
||||
ans += u'Title : ' + unicode(self.title) + u'\n'
|
||||
ans += u'Author : ' + (', '.join(self.authors) if self.authors is not None else u'None')
|
||||
ans += ((' (' + self.author_sort + ')') if self.author_sort else '') + u'\n'
|
||||
ans += u'Publisher: '+ unicode(self.publisher) + u'\n'
|
||||
ans += u'Category : ' + unicode(self.category) + u'\n'
|
||||
ans += u'Comments : ' + unicode(self.comments) + u'\n'
|
||||
ans += u'ISBN : ' + unicode(self.isbn) + u'\n'
|
||||
return ans.strip()
|
||||
|
||||
def __nonzero__(self):
|
||||
|
@ -91,7 +91,9 @@ def build_combined(base_url, opts):
|
||||
if len(query) == 0:
|
||||
raise ISBNDBError('You must specify at least one of --author, --title or --publisher')
|
||||
|
||||
query = re.sub(r'\s+', '+', query)
|
||||
query = re.sub(r'\s+', '+', query)
|
||||
if isinstance(query, unicode):
|
||||
query = query.encode('utf-8')
|
||||
return base_url+'index1=combined&value1='+quote(query, '+')
|
||||
|
||||
|
||||
@ -146,7 +148,7 @@ def main(args=sys.argv):
|
||||
return 1
|
||||
|
||||
for book in create_books(opts, args):
|
||||
print book
|
||||
print unicode(book)
|
||||
|
||||
return 0
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user