GwR revisions

This commit is contained in:
GRiker 2010-09-14 14:39:13 -06:00
parent 47f7bacc78
commit d731515ad4
2 changed files with 10 additions and 6 deletions

View File

@ -555,9 +555,11 @@ class KindleOutput(OutputProfile):
periodical_date_in_title = False periodical_date_in_title = False
@classmethod @classmethod
# def tags_to_string(cls, tags):
# return u'%s <br/><span style="color: white">%s</span>' % (', '.join(tags),
# 'ttt '.join(tags)+'ttt ')
def tags_to_string(cls, tags): def tags_to_string(cls, tags):
return u'%s <br/><span style="color: white">%s</span>' % (', '.join(tags), return u'%s' % (', '.join(tags))
'ttt '.join(tags)+'ttt ')
class KindleDXOutput(OutputProfile): class KindleDXOutput(OutputProfile):

View File

@ -55,10 +55,11 @@ class Jacket(object):
img = I(fname, data=True) img = I(fname, data=True)
if self.opts.output_profile.short_name == 'kindle': if self.opts.output_profile.short_name == 'kindle':
# Original star.png size: 24x23
# Needs to be scaled by half
fname = 'star.jpg' fname = 'star.jpg'
img = save_cover_data_to(img, fname, img = save_cover_data_to(img, fname,
return_data=True) return_data=True, resize_to=[12,12])
id, href = self.oeb.manifest.generate('calibre_jacket_star', fname) id, href = self.oeb.manifest.generate('calibre_jacket_star', fname)
self.oeb.manifest.add(id, href, guess_type(fname)[0], data=img) self.oeb.manifest.add(id, href, guess_type(fname)[0], data=img)
@ -97,7 +98,7 @@ class Jacket(object):
# Render Jacket {{{ # Render Jacket {{{
def get_rating(rating, href): def get_rating(rating, href, output_profile):
ans = '' ans = ''
try: try:
num = float(rating)/2 num = float(rating)/2
@ -114,6 +115,7 @@ def get_rating(rating, href):
href, int(num))) href, int(num)))
else: else:
ans = u' '.join(u'\u2605') ans = u' '.join(u'\u2605')
return ans return ans
@ -138,7 +140,7 @@ def render_jacket(mi, output_profile, star_href=None,
except: except:
pubdate = '' pubdate = ''
rating = get_rating(mi.rating, star_href) rating = get_rating(mi.rating, star_href, output_profile)
tags = mi.tags if mi.tags else alt_tags tags = mi.tags if mi.tags else alt_tags
if tags: if tags: