tools v4.8

This commit is contained in:
Apprentice Alf
2011-10-28 07:24:15 +01:00
parent e95ed1a8ed
commit 93f02c625a
43 changed files with 1785 additions and 418 deletions

View File

@@ -140,6 +140,7 @@ class TopazBook:
def __init__(self, filename):
self.fo = file(filename, 'rb')
self.outdir = tempfile.mkdtemp()
# self.outdir = 'rawdat'
self.bookPayloadOffset = 0
self.bookHeaderRecords = {}
self.bookMetadata = {}
@@ -370,7 +371,8 @@ class TopazBook:
def cleanup(self):
if os.path.isdir(self.outdir):
shutil.rmtree(self.outdir, True)
pass
# shutil.rmtree(self.outdir, True)
def usage(progname):
print "Removes DRM protection from Topaz ebooks and extract the contents"
@@ -438,7 +440,7 @@ def main(argv=sys.argv):
tb.getHTMLZip(zipname)
print " Creating SVG ZIP Archive"
zipname = os.path.join(outdir, bookname + '_SVG' + '.htmlz')
zipname = os.path.join(outdir, bookname + '_SVG' + '.zip')
tb.getSVGZip(zipname)
print " Creating XML ZIP Archive"
@@ -450,12 +452,12 @@ def main(argv=sys.argv):
except TpzDRMError, e:
print str(e)
tb.cleanup()
# tb.cleanup()
return 1
except Exception, e:
print str(e)
tb.cleanup
# tb.cleanup
return 1
return 0