Skip to content

Commit 3a835bd

Browse files
refactoring
1 parent cf8d516 commit 3a835bd

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/installationthread.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,8 @@ def cleanup(self):
3535

3636
def run(self):
3737
try:
38-
try:
39-
shutil.rmtree(get_aegnux_installation_dir(), True)
40-
except:
41-
self.log_signal.emit(f'[WARNING] Can\'t remove existing installation.')
42-
38+
self.try_cleanup_installation()
39+
4340
self.progress_signal.emit(10)
4441

4542
if self.download_method == DownloadMethod.ONLINE:
@@ -129,6 +126,12 @@ def run(self):
129126
self.log_signal.emit(f'[ERROR] {e}')
130127
self.finished_signal.emit(False)
131128

129+
def try_cleanup_installation(self):
130+
try:
131+
shutil.rmtree(get_aegnux_installation_dir(), True)
132+
except:
133+
self.log_signal.emit(f'[WARNING] Can\'t remove existing installation.')
134+
132135
def install_vcr(self):
133136
self.log_signal.emit(f'[DEBUG] Unpacking VCR to {get_vcr_dir_path()}...')
134137
self.unpack_zip(VCR_ZIP, get_vcr_dir_path().as_posix())

0 commit comments

Comments
 (0)