mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 05:40:26 +02:00
Use platformdirs for finding the desktop path
This commit is contained in:
+2
-1
@@ -1 +1,2 @@
|
||||
- Added voice mixing functionality that enables combining multiple voices into a single "Mixed voice", as suggested by @PulsarFTW in #1. (Special thanks to @jborza for making this feature possible with his contributions in #5)
|
||||
- Added voice mixing functionality that enables combining multiple voices into a single "Mixed voice", as suggested by @PulsarFTW in #1. (Special thanks to @jborza for making this feature possible with his contributions in #5)
|
||||
- Switched to platformdirs for determining the correct desktop path, instead of using old methods.
|
||||
@@ -4,6 +4,7 @@ import tempfile
|
||||
import time
|
||||
import chardet
|
||||
import charset_normalizer
|
||||
from platformdirs import user_desktop_dir
|
||||
from PyQt5.QtCore import QThread, pyqtSignal, Qt
|
||||
from PyQt5.QtWidgets import QCheckBox, QVBoxLayout, QDialog, QLabel, QDialogButtonBox
|
||||
import soundfile as sf
|
||||
@@ -280,7 +281,7 @@ class ConversionThread(QThread):
|
||||
base_path = self.display_path if self.display_path else self.file_name
|
||||
base_name = os.path.splitext(os.path.basename(base_path))[0]
|
||||
if self.save_option == "Save to Desktop":
|
||||
parent_dir = os.path.join(os.path.expanduser("~"), "Desktop")
|
||||
parent_dir = user_desktop_dir()
|
||||
elif self.save_option == "Save next to input file":
|
||||
parent_dir = os.path.dirname(base_path)
|
||||
else:
|
||||
|
||||
+2
-1
@@ -72,6 +72,7 @@ from constants import (
|
||||
)
|
||||
from threading import Thread
|
||||
from voice_formula_gui import VoiceFormulaDialog
|
||||
from platformdirs import user_desktop_dir
|
||||
|
||||
# Import ctypes for Windows-specific taskbar icon
|
||||
if platform.system() == "Windows":
|
||||
@@ -1628,7 +1629,7 @@ class abogen(QWidget):
|
||||
|
||||
try:
|
||||
# where to put the .lnk
|
||||
desktop = os.path.join(os.environ.get("USERPROFILE", ""), "Desktop")
|
||||
desktop = user_desktop_dir()
|
||||
shortcut_path = os.path.join(desktop, "abogen.lnk")
|
||||
|
||||
# target exe
|
||||
|
||||
@@ -18,6 +18,7 @@ dependencies = [
|
||||
"ebooklib>=0.18",
|
||||
"beautifulsoup4>=4.13.4",
|
||||
"PyMuPDF>=1.25.5",
|
||||
"platformdirs>=4.3.7",
|
||||
"soundfile>=0.13.1",
|
||||
"pygame>=2.6.1",
|
||||
"charset_normalizer>=3.4.1",
|
||||
|
||||
Reference in New Issue
Block a user