def __call__(self, oeb, context): oeb.logger.info('Converting XHTML to Mobipocket markup...') self.oeb = oeb self.log = self.oeb.logger self.opts = context self.profile = profile = context.dest self.fnums = fnums = dict((v, k) for k, v in profile.fnums.items()) self.fmap = KeyMapper(profile.fbase, profile.fbase, fnums.keys()) self.mobimlize_spine()
def calculate(self, *args): sbase = self.input_base_font_size.value() dbase = self.dbase fsize = self.input_font_size.value() try: fsizes = self.fsizes except: return if dbase == 0.0 or not fsizes: pd, pfs = self.get_profile_values() if dbase == 0.0: dbase = pd if not fsizes: fsizes = pfs from calibre.ebooks.oeb.transforms.flatcss import KeyMapper mapper = KeyMapper(sbase, dbase, fsizes) msize = mapper[fsize] self.input_mapped_font_size.setText('%.1f pt'%msize)