コード例 #1
0
ファイル: rtf_input.py プロジェクト: zyxw121/webcal
 def replace_wmf(self, name):
     if self.opts.ignore_wmf:
         os.remove(name)
         return '__REMOVE_ME__'
     from calibre.ebooks.covers import message_image
     if self.default_img is None:
         self.default_img = message_image('Conversion of WMF images is not supported.'
         ' Use Microsoft Word or OpenOffice to save this RTF file'
         ' as HTML and convert that in calibre.')
     name = name.replace('.wmf', '.jpg')
     with lopen(name, 'wb') as f:
         f.write(self.default_img)
     return name
コード例 #2
0
ファイル: rtf_input.py プロジェクト: auspex/calibre
 def replace_wmf(self, name):
     if self.opts.ignore_wmf:
         os.remove(name)
         return '__REMOVE_ME__'
     from calibre.ebooks.covers import message_image
     if self.default_img is None:
         self.default_img = message_image('Conversion of WMF images is not supported.',
         ' Use Microsoft Word or OpenOffice to save this RTF file'
         ' as HTML and convert that in calibre.')
     name = name.replace('.wmf', '.jpg')
     with lopen(name, 'wb') as f:
         f.write(self.default_img)
     return name