コード例 #1
0
 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
コード例 #2
0
 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
コード例 #3
0
 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
コード例 #4
0
 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
コード例 #5
0
 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
コード例 #6
0
 def unpackMOBI(self, outdir):
     _mu.unpackBook(self.infile,
                    outdir,
                    epubver=self.ePubVersion,
                    use_hd=self.useHDImages)
コード例 #7
0
 def unpackMOBI(self, outdir):
     _mu.unpackBook(self.infile, outdir, epubver=self.ePubVersion, use_hd=self.useHDImages)
コード例 #8
0
 def unpackMOBI(self, outdir):
     _mu.unpackBook(self.infile,
                    outdir,
                    epubver=self.ePubVersion,
                    use_hd=self.useHDImages,
                    contentdir=self.kindleContentDir)