This commit is contained in:
Kovid Goyal 2007-12-03 20:49:47 +00:00
parent 4496ba5d89
commit 8bdcbf3058
2 changed files with 12 additions and 10 deletions

View File

@ -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):

View File

@ -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