--- a/Plugins/PluginPipInterface.py Sun Feb 17 18:33:42 2019 +0100 +++ b/Plugins/PluginPipInterface.py Sun Feb 17 19:19:30 2019 +0100 @@ -39,71 +39,71 @@ pipPluginObject = None -def exeDisplayDataList(): - """ - Module function to support the display of some executable info. - - @return list of dictionaries containing the data to query the presence of - the executable - """ - global pipPluginObject - - dataList = [] - data = { - "programEntry": True, - "header": QCoreApplication.translate( - "PipInterfacePlugin", "Package Management - pip"), - "exe": "dummyExe", - "versionCommand": "--version", - "versionStartsWith": "pip", - "versionPosition": 1, - "version": "", - "versionCleanup": None, - "exeModule": ["-m", "pip"], - } - virtualenvManager = e5App().getObject("VirtualEnvManager") - for venvName in virtualenvManager.getVirtualenvNames(): - interpreter = virtualenvManager.getVirtualenvInterpreter(venvName) - data["exe"] = interpreter - dataList.append(data.copy()) - return dataList - - -def createPipPage(configDlg): - """ - Module function to create the pip configuration page. - - @param configDlg reference to the configuration dialog - @return reference to the configuration page - """ - global pipPluginObject - from UiExtensionPlugins.PipInterface.ConfigurationPage.PipPage import \ - PipPage - page = PipPage(pipPluginObject) - return page - - -def getConfigData(): - """ - Module function returning data as required by the configuration dialog. - - @return dictionary containing the relevant data - """ - return { - "pipPage": [ - QCoreApplication.translate( - "PipInterfacePlugin", "Python Package Management"), - "pypi.png", - createPipPage, None, None - ], - } - - -def prepareUninstall(): - """ - Module function to prepare for an un-installation. - """ - Preferences.Prefs.settings.remove(PipInterfacePlugin.PreferencesKey) +##def exeDisplayDataList(): +## """ +## Module function to support the display of some executable info. +## +## @return list of dictionaries containing the data to query the presence of +## the executable +## """ +## global pipPluginObject +## +## dataList = [] +## data = { +## "programEntry": True, +## "header": QCoreApplication.translate( +## "PipInterfacePlugin", "Package Management - pip"), +## "exe": "dummyExe", +## "versionCommand": "--version", +## "versionStartsWith": "pip", +## "versionPosition": 1, +## "version": "", +## "versionCleanup": None, +## "exeModule": ["-m", "pip"], +## } +## virtualenvManager = e5App().getObject("VirtualEnvManager") +## for venvName in virtualenvManager.getVirtualenvNames(): +## interpreter = virtualenvManager.getVirtualenvInterpreter(venvName) +## data["exe"] = interpreter +## dataList.append(data.copy()) +## return dataList +## +## +##def createPipPage(configDlg): +## """ +## Module function to create the pip configuration page. +## +## @param configDlg reference to the configuration dialog +## @return reference to the configuration page +## """ +## global pipPluginObject +## from UiExtensionPlugins.PipInterface.ConfigurationPage.PipPage import \ +## PipPage +## page = PipPage(pipPluginObject) +## return page +## +## +##def getConfigData(): +## """ +## Module function returning data as required by the configuration dialog. +## +## @return dictionary containing the relevant data +## """ +## return { +## "pipPage": [ +## QCoreApplication.translate( +## "PipInterfacePlugin", "Python Package Management"), +## "pypi.png", +## createPipPage, None, None +## ], +## } +## +## +##def prepareUninstall(): +## """ +## Module function to prepare for an un-installation. +## """ +## Preferences.Prefs.settings.remove(PipInterfacePlugin.PreferencesKey) class PipInterfacePlugin(QObject): @@ -176,33 +176,33 @@ self.__mainAct = None self.__initialize() - - def getPreferences(self, key): - """ - Public method to retrieve the various pip related settings. - - @param key the key of the value to get - @type str - @return the requested setting - @rtype any - """ - return Preferences.Prefs.settings.value( - self.PreferencesKey + "/" + key, self.__defaults[key]) - - def setPreferences(self, key, value): - """ - Public method to store the various pip related settings. - - @param key the key of the setting to be set - @type str - @param value the value to be set - @type any - """ - Preferences.Prefs.settings.setValue( - self.PreferencesKey + "/" + key, value) - - if key == "CurrentEnvironment": - self.currentEnvironmentChanged.emit(value) +## +## def getPreferences(self, key): +## """ +## Public method to retrieve the various pip related settings. +## +## @param key the key of the value to get +## @type str +## @return the requested setting +## @rtype any +## """ +## return Preferences.Prefs.settings.value( +## self.PreferencesKey + "/" + key, self.__defaults[key]) +## +## def setPreferences(self, key, value): +## """ +## Public method to store the various pip related settings. +## +## @param key the key of the setting to be set +## @type str +## @param value the value to be set +## @type any +## """ +## Preferences.Prefs.settings.setValue( +## self.PreferencesKey + "/" + key, value) +## +## if key == "CurrentEnvironment": +## self.currentEnvironmentChanged.emit(value) def getMenu(self, name): """