5 |
5 |
6 """ |
6 """ |
7 Module implementing the Editor File Handling configuration page. |
7 Module implementing the Editor File Handling configuration page. |
8 """ |
8 """ |
9 |
9 |
10 import sys |
10 import importlib |
11 |
11 |
12 from PyQt6.Qsci import QsciScintilla |
12 from PyQt6.Qsci import QsciScintilla |
13 from PyQt6.QtCore import pyqtSlot |
13 from PyQt6.QtCore import pyqtSlot |
14 from PyQt6.QtWidgets import QInputDialog, QLineEdit, QListWidgetItem |
14 from PyQt6.QtWidgets import QInputDialog, QLineEdit, QListWidgetItem |
15 |
15 |
400 |
400 |
401 def polishPage(self): |
401 def polishPage(self): |
402 """ |
402 """ |
403 Public slot to perform some polishing actions. |
403 Public slot to perform some polishing actions. |
404 """ |
404 """ |
405 try: |
405 self.previewMarkdownPyMdownInstallPushButton.setEnabled( |
406 import pymdownx # __IGNORE_WARNING__ |
406 bool(importlib.util.find_spec("pymdownx")) |
407 |
407 ) |
408 self.previewMarkdownPyMdownInstallPushButton.setEnabled(False) |
|
409 del sys.modules["pymdownx"] |
|
410 except ImportError: |
|
411 self.previewMarkdownPyMdownInstallPushButton.setEnabled(True) |
|
412 |
408 |
413 |
409 |
414 def create(dlg): # noqa: U100 |
410 def create(dlg): # noqa: U100 |
415 """ |
411 """ |
416 Module function to create the configuration page. |
412 Module function to create the configuration page. |