mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 05:40:26 +02:00
Fix replace single newlines preview, remove unused imports
This commit is contained in:
@@ -4,9 +4,8 @@ import base64
|
|||||||
import fitz # PyMuPDF for PDF support
|
import fitz # PyMuPDF for PDF support
|
||||||
from ebooklib import epub
|
from ebooklib import epub
|
||||||
from bs4 import BeautifulSoup, NavigableString
|
from bs4 import BeautifulSoup, NavigableString
|
||||||
from PyQt6.QtGui import QAction, QMovie, QFont
|
from PyQt6.QtGui import QMovie
|
||||||
from PyQt6.QtWidgets import (
|
from PyQt6.QtWidgets import (
|
||||||
QApplication,
|
|
||||||
QDialog,
|
QDialog,
|
||||||
QTreeWidget,
|
QTreeWidget,
|
||||||
QTreeWidgetItem,
|
QTreeWidgetItem,
|
||||||
@@ -26,11 +25,7 @@ from PyQt6.QtCore import (
|
|||||||
Qt,
|
Qt,
|
||||||
QThread,
|
QThread,
|
||||||
pyqtSignal,
|
pyqtSignal,
|
||||||
QObject,
|
|
||||||
QSize,
|
QSize,
|
||||||
QEvent,
|
|
||||||
QPoint,
|
|
||||||
QRect,
|
|
||||||
)
|
)
|
||||||
from abogen.utils import (
|
from abogen.utils import (
|
||||||
clean_text,
|
clean_text,
|
||||||
@@ -1959,7 +1954,9 @@ class HandlerDialog(QDialog):
|
|||||||
title = current.text(0)
|
title = current.text(0)
|
||||||
self.previewEdit.setPlainText(f"{title}\n\n(This item is empty)")
|
self.previewEdit.setPlainText(f"{title}\n\n(This item is empty)")
|
||||||
else:
|
else:
|
||||||
self.previewEdit.setPlainText(text)
|
# Apply clean_text to preview so replace_single_newlines setting is respected
|
||||||
|
cleaned_text = clean_text(text)
|
||||||
|
self.previewEdit.setPlainText(cleaned_text)
|
||||||
|
|
||||||
def _display_book_info(self):
|
def _display_book_info(self):
|
||||||
self.previewEdit.clear()
|
self.previewEdit.clear()
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import abogen.hf_tracker as hf_tracker
|
|||||||
import hashlib # Added for cache path generation
|
import hashlib # Added for cache path generation
|
||||||
from PyQt6.QtWidgets import (
|
from PyQt6.QtWidgets import (
|
||||||
QApplication,
|
QApplication,
|
||||||
QMainWindow,
|
|
||||||
QWidget,
|
QWidget,
|
||||||
QVBoxLayout,
|
QVBoxLayout,
|
||||||
QHBoxLayout,
|
QHBoxLayout,
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
from json import load
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import platform
|
import platform
|
||||||
@@ -40,11 +39,8 @@ if platform.system() == "Windows":
|
|||||||
from PyQt6.QtWidgets import QApplication
|
from PyQt6.QtWidgets import QApplication
|
||||||
from PyQt6.QtGui import QIcon
|
from PyQt6.QtGui import QIcon
|
||||||
from PyQt6.QtCore import (
|
from PyQt6.QtCore import (
|
||||||
Qt,
|
|
||||||
QLibraryInfo,
|
QLibraryInfo,
|
||||||
qInstallMessageHandler,
|
qInstallMessageHandler,
|
||||||
QStandardPaths,
|
|
||||||
QSettings,
|
|
||||||
QtMsgType,
|
QtMsgType,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user