Improved cleanup (close #58)

This commit is contained in:
Paweł Jastrzębski
2013-08-15 10:05:03 +02:00
parent 6b002a8475
commit e32018e8f6
3 changed files with 16 additions and 7 deletions
+3 -3
View File
@@ -364,7 +364,7 @@ def dirImgProcess(path):
pass
if not GUI.conversionAlive:
pool.terminate()
rmtree(path)
rmtree(os.path.join(path, '..', '..'))
raise UserWarning("Conversion interrupted.")
GUI.emit(QtCore.SIGNAL("progressBarTick"))
pool.join()
@@ -372,7 +372,7 @@ def dirImgProcess(path):
try:
splitpages = splitpages.get()
except:
rmtree(path)
rmtree(os.path.join(path, '..', '..'))
raise RuntimeError("One of workers crashed. Cause: " + str(sys.exc_info()[1]))
splitpages = filter(None, splitpages)
splitpages.sort()
@@ -382,7 +382,7 @@ def dirImgProcess(path):
pagenumbermodifier += 1
pagenumbermodifier += 1
else:
rmtree(path)
rmtree(os.path.join(path, '..', '..'))
raise UserWarning("Source directory is empty.")