52 self.requirementsFilePicker.setFilters( |
52 self.requirementsFilePicker.setFilters( |
53 self.tr("Text Files (*.txt);;All Files (*)")) |
53 self.tr("Text Files (*.txt);;All Files (*)")) |
54 |
54 |
55 self.__pip = pip |
55 self.__pip = pip |
56 |
56 |
57 self.venvComboBox.addItem(pip.getDefaultEnvironmentString()) |
|
58 projectVenv = self.__pip.getProjectEnvironmentString() |
|
59 if projectVenv: |
|
60 self.venvComboBox.addItem(projectVenv) |
|
61 self.venvComboBox.addItems(pip.getVirtualenvNames()) |
|
62 |
|
63 self.__requirementsEdited = False |
57 self.__requirementsEdited = False |
64 self.__requirementsAvailable = False |
58 self.__requirementsAvailable = False |
65 |
59 |
66 self.__updateButtons() |
60 self.__updateButtons() |
67 |
61 |
72 @param e close event |
66 @param e close event |
73 @type QCloseEvent |
67 @type QCloseEvent |
74 """ |
68 """ |
75 QApplication.restoreOverrideCursor() |
69 QApplication.restoreOverrideCursor() |
76 e.accept() |
70 e.accept() |
77 |
|
78 @pyqtSlot(str) |
|
79 def on_venvComboBox_activated(self, txt): |
|
80 """ |
|
81 Private slot handling the selection of a virtual environment. |
|
82 |
|
83 @param txt virtual environment |
|
84 @type str |
|
85 """ |
|
86 self.__refresh() |
|
87 |
71 |
88 @pyqtSlot(bool) |
72 @pyqtSlot(bool) |
89 def on_localCheckBox_clicked(self, checked): |
73 def on_localCheckBox_clicked(self, checked): |
90 """ |
74 """ |
91 Private slot handling the switching of the local mode. |
75 Private slot handling the switching of the local mode. |
138 else: |
122 else: |
139 ok = True |
123 ok = True |
140 if ok: |
124 if ok: |
141 self.start() |
125 self.start() |
142 |
126 |
143 def start(self): |
127 def start(self, venvName): |
144 """ |
128 """ |
145 Public method to start the command. |
129 Public method to start the command. |
|
130 |
|
131 @param venvName name of the environment to act upon |
|
132 @type str |
146 """ |
133 """ |
147 self.requirementsEdit.clear() |
134 self.requirementsEdit.clear() |
148 self.__requirementsAvailable = False |
135 self.__requirementsAvailable = False |
149 |
136 |
150 venvName = self.venvComboBox.currentText() |
|
151 interpreter = self.__pip.getVirtualenvInterpreter(venvName) |
137 interpreter = self.__pip.getVirtualenvInterpreter(venvName) |
152 if not interpreter: |
138 if not interpreter: |
153 return |
139 return |
154 |
140 |
155 args = ["-m", "pip", "freeze"] |
141 args = ["-m", "pip", "freeze"] |