ProjectDjango/ConfigurationPage/DjangoPage.py

changeset 161
208fced62e00
parent 148
4cb7aa43845d
child 163
1622130167bb
diff -r e2084f0a28a2 -r 208fced62e00 ProjectDjango/ConfigurationPage/DjangoPage.py
--- a/ProjectDjango/ConfigurationPage/DjangoPage.py	Sat May 23 11:14:54 2020 +0200
+++ b/ProjectDjango/ConfigurationPage/DjangoPage.py	Mon Jun 22 19:32:12 2020 +0200
@@ -15,8 +15,9 @@
 from E5Gui.E5Completers import E5DirCompleter, E5FileCompleter
 from E5Gui.E5Application import e5App
 
-from Preferences.ConfigurationPages.ConfigurationPageBase import \
+from Preferences.ConfigurationPages.ConfigurationPageBase import (
     ConfigurationPageBase
+)
 from .Ui_DjangoPage import Ui_DjangoPage
 
 from Globals import isWindowsPlatform, isMacPlatform
@@ -40,11 +41,9 @@
         self.setObjectName("DjangoPage")
         
         self.virtualEnvPy3Button.setIcon(UI.PixmapCache.getIcon("open"))
-        self.virtualEnvPy2Button.setIcon(UI.PixmapCache.getIcon("open"))
         self.translationsButton.setIcon(UI.PixmapCache.getIcon("open"))
         
         self.__virtualEnvPy3Completer = E5DirCompleter(self.virtualEnvPy3Edit)
-        self.__virtualEnvPy2Completer = E5DirCompleter(self.virtualEnvPy2Edit)
         self.__translationsCompleter = E5FileCompleter(self.translationsEdit)
         
         self.__plugin = plugin
@@ -80,10 +79,6 @@
         self.consoleCommandCombo.addItems(consoleList)
         self.consoleCommandNoCloseCombo.addItems(consoleNoCloseList)
         
-        self.py2ShellCombo.addItem(self.tr("Plain Python"), "python")
-        self.py2ShellCombo.addItem(self.tr("IPython"), "ipython")
-        self.py2ShellCombo.addItem(self.tr("bpython"), "bpython")
-        
         self.py3ShellCombo.addItem(self.tr("Plain Python"), "python")
         self.py3ShellCombo.addItem(self.tr("IPython"), "ipython")
         self.py3ShellCombo.addItem(self.tr("bpython"), "bpython")
@@ -91,19 +86,15 @@
         try:
             venvManager = e5App().getObject("VirtualEnvManager")
             
-            self.py2VenvNameComboBox.addItems(
-                [""] + sorted(venvManager.getVirtualenvNamesForVariant(2)))
             self.py3VenvNameComboBox.addItems(
                 [""] + sorted(venvManager.getVirtualenvNamesForVariant(3)))
             
-            self.djangoVirtualEnvPy2Group.hide()
             self.djangoVirtualEnvPy3Group.hide()
             
             self.__hasVirtualEnvironmentManager = True
         except KeyError:
             venvManager = None
             
-            self.djangoVirtualEnvironmentPy2Group.hide()
             self.djangoVirtualEnvironmentPy3Group.hide()
             
             self.__hasVirtualEnvironmentManager = False
@@ -129,20 +120,6 @@
         
         if venvManager:
             venvName = self.__plugin.getPreferences(
-                "VirtualEnvironmentNamePy2")
-            if venvName:
-                index = self.py2VenvNameComboBox.findText(venvName)
-                if index < 0:
-                    index = 0
-                self.py2VenvNameComboBox.setCurrentIndex(index)
-        else:
-            self.virtualEnvPy2Edit.setText(
-                self.__plugin.getPreferences("VirtualEnvironmentPy2"))
-        self.py2ShellCombo.setCurrentIndex(self.py2ShellCombo.findData(
-            self.__plugin.getPreferences("Python2ConsoleType")))
-        
-        if venvManager:
-            venvName = self.__plugin.getPreferences(
                 "VirtualEnvironmentNamePy3")
             if venvName:
                 index = self.py3VenvNameComboBox.findText(venvName)
@@ -186,17 +163,6 @@
         
         if self.__hasVirtualEnvironmentManager:
             self.__plugin.setPreferences(
-                "VirtualEnvironmentNamePy2",
-                self.py2VenvNameComboBox.currentText())
-        else:
-            self.__plugin.setPreferences(
-                "VirtualEnvironmentPy2", self.virtualEnvPy2Edit.text())
-        self.__plugin.setPreferences(
-            "Python2ConsoleType",
-            self.py2ShellCombo.itemData(self.py2ShellCombo.currentIndex()))
-        
-        if self.__hasVirtualEnvironmentManager:
-            self.__plugin.setPreferences(
                 "VirtualEnvironmentNamePy3",
                 self.py3VenvNameComboBox.currentText())
         else:
@@ -231,25 +197,6 @@
                 Utilities.toNativeSeparators(virtualEnv))
     
     @pyqtSlot()
-    def on_virtualEnvPy2Button_clicked(self):
-        """
-        Private slot to select the virtual environment for Python 2 via a
-        directory selection dialog.
-        """
-        vDir = self.virtualEnvPy2Edit.text()
-        if not vDir:
-            vDir = Utilities.getHomeDir()
-        virtualEnv = E5FileDialog.getExistingDirectory(
-            self,
-            self.tr("Select Virtual Environment for Python 2"),
-            vDir,
-            E5FileDialog.Options(E5FileDialog.Option(0)))
-        
-        if virtualEnv:
-            self.virtualEnvPy2Edit.setText(
-                Utilities.toNativeSeparators(virtualEnv))
-    
-    @pyqtSlot()
     def on_translationsButton_clicked(self):
         """
         Private slot to select the translations editor via a file selection

eric ide

mercurial