IGN:Make tag_to_string in jacket profile dependent

This commit is contained in:
Kovid Goyal 2009-05-04 02:33:51 -07:00
parent 74267dc516
commit 63be1c3558
2 changed files with 10 additions and 2 deletions

View File

@ -151,6 +151,10 @@ class OutputProfile(Plugin):
# The image size for comics # The image size for comics
comic_screen_size = (584, 754) comic_screen_size = (584, 754)
@classmethod
def tags_to_string(cls, tags):
return ', '.join(tags)
class SonyReaderOutput(OutputProfile): class SonyReaderOutput(OutputProfile):
name = 'Sony Reader' name = 'Sony Reader'
@ -236,6 +240,11 @@ class KindleOutput(OutputProfile):
fbase = 16 fbase = 16
fsizes = [12, 12, 14, 16, 18, 20, 22, 24] fsizes = [12, 12, 14, 16, 18, 20, 22, 24]
@classmethod
def tags_to_string(cls, tags):
return 'ttt '.join(tags)+'ttt '
output_profiles = [OutputProfile, SonyReaderOutput, MSReaderOutput, output_profiles = [OutputProfile, SonyReaderOutput, MSReaderOutput,
MobipocketOutput, HanlinV3Output, CybookG3Output, KindleOutput, MobipocketOutput, HanlinV3Output, CybookG3Output, KindleOutput,
SonyReaderLandscapeOutput] SonyReaderLandscapeOutput]

View File

@ -70,9 +70,8 @@ class Jacket(object):
tags = map(unicode, self.oeb.metadata.subject) tags = map(unicode, self.oeb.metadata.subject)
except: except:
tags = [] tags = []
tags = u'/'.join(tags)
if tags: if tags:
tags = '<b>Tags: </b>' + u'/%s/'%tags tags = '<b>Tags: </b>' + self.opts.dest.tags_to_string(tags)
else: else:
tags = '' tags = ''
try: try: