mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
Fixed sleep inhibition error
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
# 1.1.7 (ğre-release)
|
# 1.1.7 (ğre-release)
|
||||||
- Added MPS GPU acceleration support for Silicon Mac, mentioned in https://github.com/denizsafak/abogen/issues/32#issuecomment-3155902040 by @jefro108
|
- Added MPS GPU acceleration support for Silicon Mac, mentioned in https://github.com/denizsafak/abogen/issues/32#issuecomment-3155902040 by @jefro108
|
||||||
- Added word-by-word karaoke highlighting feature by @robmckinnon in PR #65
|
- Added word-by-word karaoke highlighting feature by @robmckinnon in PR #65
|
||||||
|
- Fixed sleep inhibition error occurring on some Linux systems that do not use systemd, mentioned in #67 by @hendrack
|
||||||
|
- Improvements in code and documentation.
|
||||||
|
|
||||||
# 1.1.6
|
# 1.1.6
|
||||||
- Improved EPUB chapter detection: Now reliably detects chapters from NAV HTML (TOC) files, even in non-standard EPUBs, fixes the issue mentioned by @jefro108 in #33
|
- Improved EPUB chapter detection: Now reliably detects chapters from NAV HTML (TOC) files, even in non-standard EPUBs, fixes the issue mentioned by @jefro108 in #33
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import sys
|
|||||||
import json
|
import json
|
||||||
import warnings
|
import warnings
|
||||||
import platform
|
import platform
|
||||||
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import re
|
import re
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
@@ -286,6 +287,8 @@ def prevent_sleep_start():
|
|||||||
# Add program name and reason for inhibition
|
# Add program name and reason for inhibition
|
||||||
program_name = PROGRAM_NAME
|
program_name = PROGRAM_NAME
|
||||||
reason = "Prevent sleep during abogen process"
|
reason = "Prevent sleep during abogen process"
|
||||||
|
# Only attempt to use systemd-inhibit if it's available on the system.
|
||||||
|
if shutil.which("systemd-inhibit"):
|
||||||
_sleep_procs["Linux"] = create_process(
|
_sleep_procs["Linux"] = create_process(
|
||||||
[
|
[
|
||||||
"systemd-inhibit",
|
"systemd-inhibit",
|
||||||
@@ -297,6 +300,11 @@ def prevent_sleep_start():
|
|||||||
"infinity",
|
"infinity",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
# Non-systemd distro or systemd tools not installed: skip inhibition rather than crash
|
||||||
|
print(
|
||||||
|
"systemd-inhibit not found: skipping sleep inhibition on this Linux system."
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def prevent_sleep_end():
|
def prevent_sleep_end():
|
||||||
|
|||||||
Reference in New Issue
Block a user