eric6/Preferences/ConfigurationPages/EditorFilePage.py

changeset 8258
82b608e352ec
parent 8222
5994b80b8760
--- a/eric6/Preferences/ConfigurationPages/EditorFilePage.py	Tue Apr 20 19:47:39 2021 +0200
+++ b/eric6/Preferences/ConfigurationPages/EditorFilePage.py	Wed Apr 21 17:56:12 2021 +0200
@@ -362,7 +362,19 @@
         """
         pip = e5App().getObject("Pip")
         pip.installPackages(["pymdown-extensions"], interpreter=sys.executable)
-    
+        self.polishPage()
+        
+    def polishPage(self):
+        """
+        Public slot to perform some polishing actions.
+        """
+        try:
+            import pymdownx     # __IGNORE_WARNING__
+            self.previewMarkdownPyMdownInstallPushButton.setEnabled(False)
+            del sys.modules["pymdownx"]
+        except ImportError:
+            self.previewMarkdownPyMdownInstallPushButton.setEnabled(True)
+
 
 def create(dlg):
     """

eric ide

mercurial