mirror of
https://github.com/ciromattia/kcc
synced 2025-12-18 20:21:48 +00:00
fix flatpak kindlegen detection (7.5.0 regression) (#1000)
* fix flatpak kindlegen detection * fix shared
This commit is contained in:
@@ -30,7 +30,7 @@ import sys
|
|||||||
from urllib.parse import unquote
|
from urllib.parse import unquote
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from shutil import move, rmtree
|
from shutil import move, rmtree
|
||||||
from subprocess import STDOUT, PIPE
|
from subprocess import STDOUT, PIPE, CalledProcessError
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from xml.sax.saxutils import escape
|
from xml.sax.saxutils import escape
|
||||||
@@ -945,7 +945,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
|
|||||||
self.addMessage('Your <a href="https://www.amazon.com/b?node=23496309011">KindleGen</a>'
|
self.addMessage('Your <a href="https://www.amazon.com/b?node=23496309011">KindleGen</a>'
|
||||||
' is outdated! MOBI conversion might fail.', 'warning')
|
' is outdated! MOBI conversion might fail.', 'warning')
|
||||||
break
|
break
|
||||||
except FileNotFoundError:
|
except (FileNotFoundError, CalledProcessError):
|
||||||
self.kindleGen = False
|
self.kindleGen = False
|
||||||
if startup:
|
if startup:
|
||||||
self.display_kindlegen_missing()
|
self.display_kindlegen_missing()
|
||||||
|
|||||||
@@ -1238,7 +1238,7 @@ def checkTools(source):
|
|||||||
if options.format == 'MOBI':
|
if options.format == 'MOBI':
|
||||||
try:
|
try:
|
||||||
subprocess_run(['kindlegen', '-locale', 'en'], stdout=PIPE, stderr=STDOUT, check=True)
|
subprocess_run(['kindlegen', '-locale', 'en'], stdout=PIPE, stderr=STDOUT, check=True)
|
||||||
except FileNotFoundError:
|
except (FileNotFoundError, CalledProcessError):
|
||||||
print('ERROR: KindleGen is missing!')
|
print('ERROR: KindleGen is missing!')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
import os
|
import os
|
||||||
from hashlib import md5
|
|
||||||
from html.parser import HTMLParser
|
from html.parser import HTMLParser
|
||||||
import subprocess
|
import subprocess
|
||||||
from packaging.version import Version
|
from packaging.version import Version
|
||||||
@@ -140,7 +139,7 @@ def available_archive_tools():
|
|||||||
try:
|
try:
|
||||||
subprocess_run([tool], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
subprocess_run([tool], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
available.append(tool)
|
available.append(tool)
|
||||||
except FileNotFoundError:
|
except (FileNotFoundError, subprocess.CalledProcessError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return available
|
return available
|
||||||
|
|||||||
Reference in New Issue
Block a user