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 = []
|
self.tags = []
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
ans = ''
|
ans = u''
|
||||||
ans += 'Title : ' + unicode(self.title) + '\n'
|
ans += u'Title : ' + unicode(self.title) + u'\n'
|
||||||
ans += 'Author : ' + (', '.join(self.authors) if self.authors is not None else 'None')
|
ans += u'Author : ' + (', '.join(self.authors) if self.authors is not None else u'None')
|
||||||
ans += ((' (' + self.author_sort + ')') if self.author_sort else '') + '\n'
|
ans += ((' (' + self.author_sort + ')') if self.author_sort else '') + u'\n'
|
||||||
ans += 'Publisher: '+ unicode(self.publisher) + '\n'
|
ans += u'Publisher: '+ unicode(self.publisher) + u'\n'
|
||||||
ans += 'Category : ' + unicode(self.category) + '\n'
|
ans += u'Category : ' + unicode(self.category) + u'\n'
|
||||||
ans += 'Comments : ' + unicode(self.comments) + '\n'
|
ans += u'Comments : ' + unicode(self.comments) + u'\n'
|
||||||
ans += 'ISBN : ' + unicode(self.isbn) + '\n'
|
ans += u'ISBN : ' + unicode(self.isbn) + u'\n'
|
||||||
return ans.strip()
|
return ans.strip()
|
||||||
|
|
||||||
def __nonzero__(self):
|
def __nonzero__(self):
|
||||||
|
@ -92,6 +92,8 @@ def build_combined(base_url, opts):
|
|||||||
raise ISBNDBError('You must specify at least one of --author, --title or --publisher')
|
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, '+')
|
return base_url+'index1=combined&value1='+quote(query, '+')
|
||||||
|
|
||||||
|
|
||||||
@ -146,7 +148,7 @@ def main(args=sys.argv):
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
for book in create_books(opts, args):
|
for book in create_books(opts, args):
|
||||||
print book
|
print unicode(book)
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user