mirror of
https://github.com/ciromattia/kcc
synced 2025-12-13 09:46:25 +00:00
Fix Mac CBZ, CBR, damaged, cover upload
.decode("utf-8")
edit kindlegen text
adjust 7z text
add unar
delete spec
remove 7z binaries
change path priorities
add 7z location for m1
delete plist
fix mac cover upload
This commit is contained in:
@@ -757,7 +757,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
|
||||
if sys.platform.startswith('win'):
|
||||
self.addMessage('Download it and place EXE in KCC directory.', 'error')
|
||||
elif sys.platform.startswith('darwin'):
|
||||
self.addMessage('<a href="https://github.com/ciromattia/kcc/wiki/Installation/_edit#kindlegen">'
|
||||
self.addMessage('<a href="https://github.com/ciromattia/kcc/wiki/Installation#kindlegen">'
|
||||
'Install the kindle-comic-creator cask using Homebrew</a> to enable MOBI conversion',
|
||||
'error')
|
||||
else:
|
||||
@@ -1046,7 +1046,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
|
||||
self.sevenzip = True
|
||||
else:
|
||||
self.sevenzip = False
|
||||
self.addMessage('<a href="https://github.com/ciromattia/kcc/wiki/Installation#7-zip">Install 7z and add to PATH!</a>!'
|
||||
self.addMessage('<a href="https://github.com/ciromattia/kcc/wiki/Installation#7-zip">Cannot find 7z</a>!'
|
||||
' CBZ/CBR/ZIP/etc processing disabled.', 'warning')
|
||||
self.detectKindleGen(True)
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
#
|
||||
|
||||
import os
|
||||
import platform
|
||||
import subprocess
|
||||
import distro
|
||||
from psutil import Popen
|
||||
from shutil import move
|
||||
@@ -65,6 +67,11 @@ class ComicArchive:
|
||||
process.communicate()
|
||||
if process.returncode != 0:
|
||||
raise OSError('Failed to extract archive.')
|
||||
elif process.returncode != 0 and platform.system() == 'Darwin':
|
||||
process = subprocess.run(f"unar '{self.filepath}' -f -o '{targetdir}'",
|
||||
stdout=PIPE, stderr=STDOUT, stdin=PIPE, shell=True)
|
||||
if process.returncode != 0:
|
||||
raise Exception(process.stdout.decode("utf-8"))
|
||||
elif process.returncode != 0:
|
||||
raise OSError('Failed to extract archive. Check if p7zip-rar is installed.')
|
||||
tdir = os.listdir(targetdir)
|
||||
|
||||
Reference in New Issue
Block a user