362 typeNamesMapping = { |
362 typeNamesMapping = { |
363 n[0]: n[1] for n in self.__manager.getEnvironmentTypeNames() |
363 n[0]: n[1] for n in self.__manager.getEnvironmentTypeNames() |
364 } |
364 } |
365 |
365 |
366 for environment in self.__manager.getEnvironmentEntries(): |
366 for environment in self.__manager.getEnvironmentEntries(): |
|
367 try: |
|
368 environmentType = typeNamesMapping[environment.environment_type] |
|
369 except KeyError: |
|
370 # Environment type was not registered or has been deactivated. |
|
371 environmentType = environment.environment_type |
367 itm = QTreeWidgetItem( |
372 itm = QTreeWidgetItem( |
368 self.venvList, |
373 self.venvList, |
369 [ |
374 [environment.name, environmentType, environment.path], |
370 environment.name, |
|
371 typeNamesMapping[environment.environment_type], |
|
372 environment.path, |
|
373 ], |
|
374 ) |
375 ) |
375 itm.setData(0, VirtualenvManagerWidget.MetadataRole, environment) |
376 itm.setData(0, VirtualenvManagerWidget.MetadataRole, environment) |
376 |
377 |
377 self.__resizeSections() |
378 self.__resizeSections() |
378 |
379 |
439 |
440 |
440 @param parent reference to the parent widget |
441 @param parent reference to the parent widget |
441 @type QWidget |
442 @type QWidget |
442 """ |
443 """ |
443 from eric7.EricWidgets.EricApplication import ericApp |
444 from eric7.EricWidgets.EricApplication import ericApp |
|
445 from eric7.CondaInterface.Conda import Conda |
444 from eric7.PluginManager.PluginManager import PluginManager |
446 from eric7.PluginManager.PluginManager import PluginManager |
445 from eric7.VirtualEnv.VirtualenvManager import VirtualenvManager |
447 from eric7.VirtualEnv.VirtualenvManager import VirtualenvManager |
446 |
448 |
447 super().__init__(parent) |
449 super().__init__(parent) |
448 |
450 |
451 |
453 |
452 self.__pluginManager = PluginManager(self) |
454 self.__pluginManager = PluginManager(self) |
453 ericApp().registerObject("PluginManager", self.__pluginManager) |
455 ericApp().registerObject("PluginManager", self.__pluginManager) |
454 self.__pluginManager.activateTypedPlugins("virtualenv") |
456 self.__pluginManager.activateTypedPlugins("virtualenv") |
455 |
457 |
|
458 self.__conda = Conda(self) |
|
459 |
456 self.__centralWidget = QWidget(self) |
460 self.__centralWidget = QWidget(self) |
457 self.__layout = QVBoxLayout(self.__centralWidget) |
461 self.__layout = QVBoxLayout(self.__centralWidget) |
458 self.__centralWidget.setLayout(self.__layout) |
462 self.__centralWidget.setLayout(self.__layout) |
459 |
463 |
460 self.__virtualenvManagerWidget = VirtualenvManagerWidget( |
464 self.__virtualenvManagerWidget = VirtualenvManagerWidget( |