diff options
author | Paweł Jastrzębski <pawelj@iosphe.re> | 2019-03-07 08:26:31 +0100 |
---|---|---|
committer | Paweł Jastrzębski <pawelj@iosphe.re> | 2019-03-07 08:26:31 +0100 |
commit | 4891913b5c4a1bd410b0ccf92cbd08742bfeee00 (patch) | |
tree | 4565827d2ffcdea1f276116120d971fa2822d006 /kindlecomicconverter/KCC_gui.py | |
parent | Fixed bookmark parsing (close #229) (diff) | |
download | kcc-4891913b5c4a1bd410b0ccf92cbd08742bfeee00.tar.gz kcc-4891913b5c4a1bd410b0ccf92cbd08742bfeee00.tar.bz2 kcc-4891913b5c4a1bd410b0ccf92cbd08742bfeee00.zip |
Added additional cleanup
Diffstat (limited to 'kindlecomicconverter/KCC_gui.py')
-rw-r--r-- | kindlecomicconverter/KCC_gui.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/kindlecomicconverter/KCC_gui.py b/kindlecomicconverter/KCC_gui.py index 33ef984..8449e37 100644 --- a/kindlecomicconverter/KCC_gui.py +++ b/kindlecomicconverter/KCC_gui.py @@ -22,7 +22,7 @@ import sys from urllib.parse import unquote from urllib.request import urlopen, urlretrieve, Request from time import sleep -from shutil import move +from shutil import move, rmtree from subprocess import STDOUT, PIPE # noinspection PyUnresolvedReferences from PyQt5 import QtGui, QtCore, QtWidgets, QtNetwork @@ -32,7 +32,8 @@ from psutil import Popen, Process from copy import copy from distutils.version import StrictVersion from raven import Client -from .shared import md5Checksum, HTMLStripper, sanitizeTrace +from tempfile import gettempdir +from .shared import md5Checksum, HTMLStripper, sanitizeTrace, walkLevel from . import __version__ from . import comic2ebook from . import metadata @@ -1067,6 +1068,12 @@ class KCCGUI(KCC_ui.Ui_mainWindow): self.versionCheck.start() self.tray.show() + # Cleanup unfisnished conversion + for root, dirs, _ in walkLevel(gettempdir(), 0): + for tempdir in dirs: + if tempdir.startswith('KCC-'): + rmtree(os.path.join(root, tempdir), True) + if self.windowSize != '0x0': x, y = self.windowSize.split('x') MW.resize(int(x), int(y)) |