def unpackEPUB(self, outdir): _mu.unpackBook(self.infile, outdir, epubver=self.ePubVersion, use_hd=self.useHDImages) kf8dir = os.path.join(outdir, 'mobi8') kf8BaseName = os.path.splitext(os.path.basename(self.infile))[0] epub = os.path.join(kf8dir, '{0}.epub'.format(kf8BaseName)) if not os.path.exists(epub): raise Exception(_('Problem locating unpacked epub: {0}'.format(epub))) return epub
def unpackZIP(self, outdir): _mu.unpackBook(self.infile, outdir, epubver=self.ePubVersion, use_hd=self.useHDImages, contentdir=self.kindleContentDir, format='ZIP', zipcompresstype=self.zipCompressType) kf8dir = os.path.join(outdir, 'mobi8') kf8BaseName = os.path.splitext(os.path.basename(self.infile))[0] zip = os.path.join(kf8dir, '{0}.zip'.format(kf8BaseName)) if not os.path.exists(zip): raise Exception(_( 'Problem locating unpacked zip: {0}'.format(zip))) return zip
def getPDFFile(self, outdir): _mu.unpackBook(self.infile, outdir) files = os.listdir(outdir) pdf = '' filefilter = re.compile('\.pdf$', re.IGNORECASE) files = filter(filefilter.search, files) if files: for filename in files: pdf = os.path.join(outdir, filename) break else: raise Exception(_('Problem locating unpacked pdf.')) if pdf=='': raise Exception(_('Problem locating unpacked pdf.')) if not os.path.exists(pdf): raise Exception(_('Problem locating unpacked pdf: {0}'.format(pdf))) return pdf
def unpackMOBI(self, outdir): _mu.unpackBook(self.infile, outdir, epubver=self.ePubVersion, use_hd=self.useHDImages)
def unpackMOBI(self, outdir): _mu.unpackBook(self.infile, outdir, epubver=self.ePubVersion, use_hd=self.useHDImages, contentdir=self.kindleContentDir)