Skip to content

Commit

Permalink
mobi: work with kindlegen executable in PATH directories, #401
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Nov 16, 2022
1 parent 35e748f commit cff2d55
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyglossary/plugins/ebook_mobi.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def add_group(state):
add_group(state)

def write(self):
import subprocess
import subprocess, shutil

filename = self._filename
kindlegen_path = self._kindlegen_path
Expand All @@ -322,6 +322,8 @@ def write(self):
# https://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000765211

# run kindlegen
if not kindlegen_path:
kindlegen_path = shutil.which("kindlegen")
if not kindlegen_path:
log.warning(f"Not running kindlegen, the raw files are located in {filename}")
log.warning(
Expand Down

0 comments on commit cff2d55

Please sign in to comment.