From eb4d687011bbc93c09f6392c1a8473973511a408 Mon Sep 17 00:00:00 2001 From: xxyzz Date: Tue, 7 Dec 2021 11:04:15 +0800 Subject: [PATCH] raise exception on 32bit calibre --- main.py | 18 +++++++++--------- unzip.py | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/main.py b/main.py index 1d67fe1..6afd0dc 100644 --- a/main.py +++ b/main.py @@ -96,6 +96,14 @@ def job_failed(self, job): f''' Install Visual C++ 2019 redistributable ''', job.datails) + elif '32BIT_CALIBRE' in job.details: + url = 'https://calibre-ebook.com/download_windows64' + self.error_dialog( + 'Seriously, 32bit?!', + f''' + Install 64bit calibre, + 32bit calibre is not supported. + ''', job.details) else: self.gui.job_exception(job, dialog_title='Tonnerre de Brest!') return True @@ -103,15 +111,7 @@ def job_failed(self, job): def subprocess_error(self, job): exception = job.exception.stderr - if 'C++ Build Tools' in exception: - self.error_dialog( - 'Seriously, 32bit?!', - ''' - Install - 64bit calibre, 32bit calibre is not supported. - ''', - job.details + exception) - elif 'No module named pip' in exception: + if 'No module named pip' in exception: self.error_dialog( 'Hello, my name is Philip, but everyone calls me Pip, ' 'because they hate me.', diff --git a/unzip.py b/unzip.py index a965068..8d999d2 100644 --- a/unzip.py +++ b/unzip.py @@ -107,7 +107,7 @@ def pip_args(pkg, pkg_version, compiled, url): if is64bit: args.append('win_amd64') else: - args.append('win32') + raise Exception('32BIT_CALIBRE') if url: args.append(url) elif pkg_version: