20 QMenu, |
20 QMenu, |
21 QTreeWidgetItem, |
21 QTreeWidgetItem, |
22 QWidget, |
22 QWidget, |
23 ) |
23 ) |
24 |
24 |
25 from eric7 import Preferences |
25 from eric7 import EricUtilities, Preferences |
26 from eric7.DataViews.PyCoverageDialog import PyCoverageDialog |
26 from eric7.DataViews.PyCoverageDialog import PyCoverageDialog |
27 from eric7.EricGui import EricPixmapCache |
27 from eric7.EricGui import EricPixmapCache |
28 from eric7.EricWidgets import EricMessageBox |
28 from eric7.EricWidgets import EricMessageBox |
29 from eric7.EricWidgets.EricApplication import ericApp |
29 from eric7.EricWidgets.EricApplication import ericApp |
30 from eric7.EricWidgets.EricMainWindow import EricMainWindow |
30 from eric7.EricWidgets.EricMainWindow import EricMainWindow |
311 if self.__project and self.__project.isOpen(): |
311 if self.__project and self.__project.isOpen(): |
312 venvName = ericApp().getObject("DebugUI").getProjectEnvironmentString() |
312 venvName = ericApp().getObject("DebugUI").getProjectEnvironmentString() |
313 if venvName: |
313 if venvName: |
314 self.venvComboBox.addItem(venvName) |
314 self.venvComboBox.addItem(venvName) |
315 self.__projectString = venvName |
315 self.__projectString = venvName |
316 self.venvComboBox.addItems(sorted(self.__venvManager.getVirtualenvNames())) |
316 self.venvComboBox.addItems( |
|
317 sorted(self.__venvManager.getVirtualenvNames(noServer=True)) |
|
318 ) |
317 self.venvComboBox.setCurrentText(currentText) |
319 self.venvComboBox.setCurrentText(currentText) |
318 |
320 |
319 def __populateTestFrameworkComboBox(self): |
321 def __populateTestFrameworkComboBox(self): |
320 """ |
322 """ |
321 Private method to (re-)populate the test framework selector. |
323 Private method to (re-)populate the test framework selector. |
461 |
463 |
462 # 2. discovery history |
464 # 2. discovery history |
463 self.__discoverHistory = [] |
465 self.__discoverHistory = [] |
464 rs = Preferences.Prefs.rsettings.value(recentNameTestDiscoverHistory) |
466 rs = Preferences.Prefs.rsettings.value(recentNameTestDiscoverHistory) |
465 if rs is not None: |
467 if rs is not None: |
466 recent = [f for f in Preferences.toList(rs) if os.path.exists(f)] |
468 recent = [f for f in EricUtilities.toList(rs) if os.path.exists(f)] |
467 self.__discoverHistory = recent[: Preferences.getDebugger("RecentNumber")] |
469 self.__discoverHistory = recent[: Preferences.getDebugger("RecentNumber")] |
468 |
470 |
469 # 3. test file history |
471 # 3. test file history |
470 self.__fileHistory = [] |
472 self.__fileHistory = [] |
471 rs = Preferences.Prefs.rsettings.value(recentNameTestFileHistory) |
473 rs = Preferences.Prefs.rsettings.value(recentNameTestFileHistory) |
472 if rs is not None: |
474 if rs is not None: |
473 recent = [f for f in Preferences.toList(rs) if os.path.exists(f)] |
475 recent = [f for f in EricUtilities.toList(rs) if os.path.exists(f)] |
474 self.__fileHistory = recent[: Preferences.getDebugger("RecentNumber")] |
476 self.__fileHistory = recent[: Preferences.getDebugger("RecentNumber")] |
475 |
477 |
476 # 4. test name history |
478 # 4. test name history |
477 self.__testNameHistory = [] |
479 self.__testNameHistory = [] |
478 rs = Preferences.Prefs.rsettings.value(recentNameTestNameHistory) |
480 rs = Preferences.Prefs.rsettings.value(recentNameTestNameHistory) |
479 if rs is not None: |
481 if rs is not None: |
480 recent = [n for n in Preferences.toList(rs) if n] |
482 recent = [n for n in EricUtilities.toList(rs) if n] |
481 self.__testNameHistory = recent[: Preferences.getDebugger("RecentNumber")] |
483 self.__testNameHistory = recent[: Preferences.getDebugger("RecentNumber")] |
482 |
484 |
483 def __saveRecent(self): |
485 def __saveRecent(self): |
484 """ |
486 """ |
485 Private method to save the most recently used lists. |
487 Private method to save the most recently used lists. |