Remove references and checks for lxml
This commit is contained in:
@@ -185,12 +185,6 @@ def main(sysArgs=None):
|
||||
)
|
||||
errorCode |= 0x10
|
||||
|
||||
try:
|
||||
import lxml # noqa: F401
|
||||
except ImportError:
|
||||
errorData.append("Python module 'lxml' is missing")
|
||||
errorCode |= 0x20
|
||||
|
||||
if errorData:
|
||||
errApp = QApplication([])
|
||||
errDlg = QErrorMessage()
|
||||
|
||||
@@ -47,7 +47,6 @@ more contributions are listed on the project's <a href="https://crowdin.com/proj
|
||||
<p>
|
||||
<a href="https://www.qt.io">Qt5</a> by Qt Company<br>
|
||||
<a href="https://www.riverbankcomputing.com/software/pyqt">PyQt5</a> by Riverbank Computing<br>
|
||||
<a href="https://lxml.de">lxml</a> by Martijn Faassen<br>
|
||||
<a href="https://abiword.github.io/enchant">Enchant</a> by Dom Lachowicz<br>
|
||||
<a href="https://pyenchant.github.io/pyenchant">PyEnchant</a> by Dimitri Merejkowsky
|
||||
</p>
|
||||
|
||||
@@ -597,7 +597,7 @@ class ToOdt(Tokenizer):
|
||||
xElem = ET.SubElement(self._xText, _mkTag("text", pTag), attrib=tAttr)
|
||||
|
||||
# It's important to set the initial text field to empty, otherwise
|
||||
# lxml will add a line break if the first subelement is a span.
|
||||
# xmlIndent will add a line break if the first subelement is a span.
|
||||
xElem.text = ""
|
||||
|
||||
if not theText:
|
||||
@@ -1315,8 +1315,6 @@ class XMLParagraph:
|
||||
"""This is a helper class to manage the text content of a single
|
||||
XML element using mixed content tags.
|
||||
|
||||
See: https://lxml.de/tutorial.html#the-element-class
|
||||
|
||||
Rules:
|
||||
* The root tag can only have text set, never tail.
|
||||
* Any span must be under root, and the text in the span is set in
|
||||
|
||||
@@ -128,12 +128,6 @@ class NWErrorMessage(QDialog):
|
||||
except Exception:
|
||||
kernelVersion = "Unknown"
|
||||
|
||||
try:
|
||||
import lxml
|
||||
lxmlVersion = lxml.__version__ # type: ignore
|
||||
except Exception:
|
||||
lxmlVersion = "Unknown"
|
||||
|
||||
try:
|
||||
import enchant
|
||||
enchantVersion = enchant.__version__
|
||||
@@ -148,7 +142,6 @@ class NWErrorMessage(QDialog):
|
||||
f"Host OS: {sys.platform} ({kernelVersion})\n"
|
||||
f"Python: {sys.version.split()[0]} ({sys.hexversion:#x})\n"
|
||||
f"Qt: {QT_VERSION_STR}, PyQt: {PYQT_VERSION_STR}\n"
|
||||
f"lxml: {lxmlVersion}\n"
|
||||
f"enchant: {enchantVersion}\n\n"
|
||||
f"{exType.__name__}:\n{str(exValue)}\n\n"
|
||||
f"Traceback:\n{exTrace}\n"
|
||||
|
||||
Reference in New Issue
Block a user