eric7/Preferences/ConfigurationPages/DebuggerPython3Page.py

Thu, 30 Dec 2021 11:17:58 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 30 Dec 2021 11:17:58 +0100
branch
eric7
changeset 8881
54e42bc2437a
parent 8610
c9cd21bcbe33
permissions
-rw-r--r--

Updated copyright for 2022.

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
8881
54e42bc2437a Updated copyright for 2022.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8610
diff changeset
3 # Copyright (c) 2009 - 2022 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the Debugger Python3 configuration page.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
10 from PyQt6.QtCore import pyqtSlot
6381
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
11
8358
144a6b854f70 Sorted the eric specific extensions into packages named like the corresponding PyQt packages (i.e. EricCore,EricGui and EricWidgets).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8356
diff changeset
12 from EricWidgets.EricApplication import ericApp
144a6b854f70 Sorted the eric specific extensions into packages named like the corresponding PyQt packages (i.e. EricCore,EricGui and EricWidgets).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8356
diff changeset
13 from EricWidgets.EricPathPicker import EricPathPickerModes
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
15 from .ConfigurationPageBase import ConfigurationPageBase
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
16 from .Ui_DebuggerPython3Page import Ui_DebuggerPython3Page
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 import Preferences
6381
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
19 import UI.PixmapCache
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
21
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 class DebuggerPython3Page(ConfigurationPageBase, Ui_DebuggerPython3Page):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 Class implementing the Debugger Python3 configuration page.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 def __init__(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 """
8218
7c09585bd960 Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
30 super().__init__()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 self.setupUi(self)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 self.setObjectName("DebuggerPython3Page")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33
6346
92ed63434dce Started to remove all explicit references to Python interpreters and replace them by references to virtuak environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
34 try:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8327
diff changeset
35 self.__virtualenvManager = ericApp().getObject("VirtualEnvManager")
8610
c9cd21bcbe33 Virtual Environments
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
36 self.__standalone = False
6346
92ed63434dce Started to remove all explicit references to Python interpreters and replace them by references to virtuak environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
37 except KeyError:
92ed63434dce Started to remove all explicit references to Python interpreters and replace them by references to virtuak environments.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
38 from VirtualEnv.VirtualenvManager import VirtualenvManager
6381
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
39 self.__virtualenvManager = VirtualenvManager()
8610
c9cd21bcbe33 Virtual Environments
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
40 self.__standalone = True
6381
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
41
8610
c9cd21bcbe33 Virtual Environments
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
42 self.venvDlgButton.setVisible(self.__standalone)
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
43 self.venvDlgButton.setIcon(UI.PixmapCache.getIcon("virtualenv"))
3186
a05eff845522 Changed all the file or directory selection buttons to QToolButton and gave them an icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
44
8610
c9cd21bcbe33 Virtual Environments
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
45 self.venvRefreshButton.setVisible(not self.__standalone)
c9cd21bcbe33 Virtual Environments
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
46 self.venvRefreshButton.setIcon(UI.PixmapCache.getIcon("reload"))
c9cd21bcbe33 Virtual Environments
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
47
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8327
diff changeset
48 self.debugClientPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE)
4574
86647045bc03 Changed the Python3 debugger page to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
49 self.debugClientPicker.setToolTip(self.tr(
86647045bc03 Changed the Python3 debugger page to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
50 "Press to select the Debug Client via a file selection dialog"))
4575
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4574
diff changeset
51 self.debugClientPicker.setFilters(self.tr("Python Files (*.py *.py3)"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52
6381
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
53 self.__populateAndSetVenvComboBox()
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
54
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 # set initial values
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 dct = Preferences.getDebugger("DebugClientType3")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 if dct == "standard":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 self.standardButton.setChecked(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 self.customButton.setChecked(True)
4574
86647045bc03 Changed the Python3 debugger page to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
61 self.debugClientPicker.setText(
5059
b619cb765507 Fixed a few bugs in the debugger interface and configuration pages related to path separator of different operating systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
62 Preferences.getDebugger("DebugClient3"), toNative=False)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 self.pyRedirectCheckBox.setChecked(
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 Preferences.getDebugger("Python3Redirect"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 self.pyNoEncodingCheckBox.setChecked(
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 Preferences.getDebugger("Python3NoEncoding"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 self.sourceExtensionsEdit.setText(
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 Preferences.getDebugger("Python3Extensions"))
6381
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
69
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 def save(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 Public slot to save the Debugger Python configuration.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 """
6357
ceb3d7c25650 DebuggerPythonPage, DebuggerPython3Page: fixed an issue causing an empty virtual environment selection to not being saved.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6349
diff changeset
74 Preferences.setDebugger(
ceb3d7c25650 DebuggerPythonPage, DebuggerPython3Page: fixed an issue causing an empty virtual environment selection to not being saved.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6349
diff changeset
75 "Python3VirtualEnv",
ceb3d7c25650 DebuggerPythonPage, DebuggerPython3Page: fixed an issue causing an empty virtual environment selection to not being saved.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6349
diff changeset
76 self.venvComboBox.currentText())
8234
fcb6b4b96274 Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
77 dct = "standard" if self.standardButton.isChecked() else "custom"
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 Preferences.setDebugger("DebugClientType3", dct)
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
79 Preferences.setDebugger(
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
80 "DebugClient3",
5059
b619cb765507 Fixed a few bugs in the debugger interface and configuration pages related to path separator of different operating systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
81 self.debugClientPicker.text(toNative=False))
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
82 Preferences.setDebugger(
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
83 "Python3Redirect",
7
c679fb30c8f3 Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
84 self.pyRedirectCheckBox.isChecked())
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
85 Preferences.setDebugger(
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
86 "Python3NoEncoding",
7
c679fb30c8f3 Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
87 self.pyNoEncodingCheckBox.isChecked())
6381
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
88
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
89 def __populateAndSetVenvComboBox(self):
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
90 """
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
91 Private method to populate and set the virtual environment combo box.
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
92 """
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
93 self.venvComboBox.clear()
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
94 self.venvComboBox.addItems(
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
95 [""] +
7635
0cdead130a81 Removed support for Python2 and removed support for Qt4 (PyQt4 and pyside).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
96 sorted(self.__virtualenvManager.getVirtualenvNames())
6381
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
97 )
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
98
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
99 # set initial value
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
100 venvName = Preferences.getDebugger("Python3VirtualEnv")
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
101 if venvName:
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
102 index = self.venvComboBox.findText(venvName)
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
103 if index < 0:
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
104 index = 0
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
105 self.venvComboBox.setCurrentIndex(index)
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
106
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
107 @pyqtSlot()
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
108 def on_refreshButton_clicked(self):
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
109 """
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
110 Private slot handling a click of the refresh button.
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
111 """
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
112 self.sourceExtensionsEdit.setText(
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
113 Preferences.getDebugger("Python3Extensions"))
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
114
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
115 @pyqtSlot()
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
116 def on_venvDlgButton_clicked(self):
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
117 """
6386
91dc4fa9bc9c Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6381
diff changeset
118 Private slot to show the virtual environment manager dialog.
6381
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
119 """
8610
c9cd21bcbe33 Virtual Environments
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
120 if self.__standalone:
c9cd21bcbe33 Virtual Environments
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
121 self.__virtualenvManager.showVirtualenvManagerDialog(modal=True)
c9cd21bcbe33 Virtual Environments
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
122 self.__populateAndSetVenvComboBox()
c9cd21bcbe33 Virtual Environments
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
123 self.activateWindow()
c9cd21bcbe33 Virtual Environments
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
124 self.raise_()
c9cd21bcbe33 Virtual Environments
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
125
c9cd21bcbe33 Virtual Environments
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
126 @pyqtSlot()
c9cd21bcbe33 Virtual Environments
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
127 def on_venvRefreshButton_clicked(self):
c9cd21bcbe33 Virtual Environments
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
128 """
c9cd21bcbe33 Virtual Environments
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
129 Private slot to reload the list of virtual environments.
c9cd21bcbe33 Virtual Environments
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
130 """
6381
37f23590dbbc Configuration pages for Python: harmonized the Python debugger pages and the Python page and added a button to show the virtual environment manager dialog to the Python configuration pages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6357
diff changeset
131 self.__populateAndSetVenvComboBox()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
133
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 def create(dlg):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 Module function to create the configuration page.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 @param dlg reference to the configuration dialog
2964
84b65fb9e780 Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
139 @return reference to the instantiated page (ConfigurationPageBase)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141 page = DebuggerPython3Page()
880
52ed20236a1c Added the option to not use the native file dialog to prevent crashes on Linux.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
142 return page

eric ide

mercurial