Fixed CBR parsing anomalies (close #133)

This commit is contained in:
Paweł Jastrzębski
2015-04-27 18:50:14 +02:00
parent 77748afdbd
commit 84fc23b979
5 changed files with 16 additions and 22 deletions
+3 -3
View File
@@ -579,7 +579,7 @@ def getWorkFolder(afile):
if len(afile) > 240:
raise UserWarning("Path is too long.")
if os.path.isdir(afile):
workdir = mkdtemp('', 'KCC-TMP-')
workdir = mkdtemp('', 'KCC-')
try:
os.rmdir(workdir)
fullPath = os.path.join(workdir, 'OEBPS', 'Images')
@@ -598,7 +598,7 @@ def getWorkFolder(afile):
rmtree(path, True)
raise UserWarning("Failed to extract images.")
else:
workdir = mkdtemp('', 'KCC-TMP-')
workdir = mkdtemp('', 'KCC-')
cbx = cbxarchive.CBxArchive(afile)
if cbx.isCbxFile():
try:
@@ -935,7 +935,7 @@ def detectMargins(path):
def createNewTome():
tomePathRoot = mkdtemp('', 'KCC-TMP-')
tomePathRoot = mkdtemp('', 'KCC-')
tomePath = os.path.join(tomePathRoot, 'OEBPS', 'Images')
os.makedirs(tomePath)
return tomePath, tomePathRoot