1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 09:46:25 +00:00

Display kindlegen path (#571)

* add %LOCALAPPDATA%\\Amazon\\KC2

* fix kindlegen link

* expandvars

* remove link

* print where kindlegen

* adjust where command

* remove platform
This commit is contained in:
Alex Xu
2023-08-07 10:53:38 -07:00
committed by GitHub
parent f73d889b6e
commit 77afa77d32
2 changed files with 9 additions and 1 deletions

View File

@@ -19,6 +19,7 @@
import json
import os
import re
import subprocess
import sys
from urllib.parse import unquote
from urllib.request import urlretrieve, urlopen
@@ -859,6 +860,12 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
self.addMessage('Your <a href="https://www.amazon.com/b?node=23496309011">KindleGen</a>'
' is outdated! MOBI conversion might fail.', 'warning')
break
where_command = 'where kindlegen.exe'
if os.name == 'posix':
where_command = 'which kindlegen'
process = subprocess.run(where_command, stdout=PIPE, stderr=STDOUT, stdin=PIPE, shell=True)
locations = process.stdout.decode('utf-8').split('\n')
self.addMessage(f"<b>KindleGen Found:</b> {locations[0]}", 'info')
else:
self.kindleGen = False
if startup: