# eric6.PipInterface.PipPackagesWidget

Module implementing the pip packages management widget.

### Global Attributes

None

### Classes

PipPackagesWidget | Class implementing the pip packages management widget.

### Functions

None

## PipPackagesWidget

Class implementing the pip packages management widget.

### Derived from

QWidget, Ui_PipPackagesWidget

### Class Attributes

SearchStopwords
SearchVersionRole
ShowProcessClassifiersMode
ShowProcessEntryPointsMode
ShowProcessFilesListMode
ShowProcessGeneralMode

### Class Methods

None

### Methods

PipPackagesWidget | Constructor
__aboutToShowPipMenu | Private slot to set the action enabled status.
__allUpdateableItems | Private method to get a list of all items that can be updated.
__editConfiguration | Private method to edit a configuration.
__editUserConfiguration | Private slot to edit the user configuration.
__editVirtualenvConfiguration | Private slot to edit the configuration of the selected environment.
__executeUpgradePackages | Private method to execute the pip upgrade command.
__finishSearch | Private slot performing the search finishing actions.
__generateRequirements | Private slot to generate the contents for a requirements file.
__initPipMenu | Private method to create the super menu and attach it to the super menu button.
__install | Private slot to install the selected packages.
__installLocalPackage | Private slot to install a package available on local storage.
__installPackages | Private slot to install packages to be given by the user.
__installPip | Private slot to install pip into the selected environment.
__installPipUser | Private slot to install pip into the user site for the selected environment.
__installRequirements | Private slot to install packages as given in a requirements file.
__isPipAvailable | Private method to check, if the pip package is available for the selected environment.
__pipConfigure | Private slot to open the configuration page.
__populateEnvironments | Private method to get a list of environments and populate the selector.
__processSearchResult | Private method to process the search result data from PyPI.
__refreshPackagesList | Private method to referesh the packages list.
__repairPip | Private slot to repair the pip installation of the selected environment.
__score | Private method to calculate some score for a search result.
__search | Private method to perform the search.
__searchError | Private method handling a search error.
__selectedUpdateableItems | Private method to get a list of selected items that can be updated.
__showPackageDetails | Private method to populate the package details dialog.
__showSearchedDetails | Private slot to show details about the selected search result package.
__transformHits | Private method to convert the list returned from pypi into a packages list.
__uninstallRequirements | Private slot to uninstall packages as given in a requirements file.
__updateActionButtons | Private method to set the state of the action buttons.
__updateSearchActionButtons | Private method to update the action button states of the search widget.
__updateSearchButton | Private method to update the state of the search button.
on_environmentsComboBox_currentIndexChanged | Private slot handling the selection of a conda environment.
on_installButton_clicked | Private slot to handle pressing the Install button..
on_installUserSiteButton_clicked | Private slot to handle pressing the Install to User-Site button..
on_installedFilesCheckBox_clicked | Private slot to handle a change of the installed files information checkbox.
on_localCheckBox_clicked | Private slot handling the switching of the local mode.
on_notRequiredCheckBox_clicked | Private slot handling the switching of the 'not required' mode.
on_packagesList_itemActivated | Private slot reacting on a package item activation.
on_packagesList_itemSelectionChanged | Private slot handling the selection of a package.
on_refreshButton_clicked | Private slot to refresh the display.
on_searchButton_clicked | Private slot handling a press of the search button.
on_searchEditName_returnPressed | Private slot initiating a search via a press of the Return key.
on_searchEditName_textChanged | Private slot handling a change of the search term.
on_searchEditSummary_returnPressed | Private slot initiating a search via a press of the Return key.
on_searchEditSummary_textChanged | Private slot handling a change of the search term.
on_searchResultList_itemActivated | Private slot reacting on an search result item activation.
on_searchResultList_itemSelectionChanged | Private slot handling changes of the search result selection.
on_searchToggleButton_toggled | Private slot to togle the search widget.
on_showDetailsButton_clicked | Private slot to handle pressing the Show Details button.
on_showPackageDetailsButton_clicked | Private slot to show information for the selected package.
on_uninstallButton_clicked | Private slot to remove selected packages of the selected environment.
on_upgradeAllButton_clicked | Private slot to upgrade all packages of the selected environment.
on_upgradeButton_clicked | Private slot to upgrade selected packages of the selected environment.
on_userCheckBox_clicked | Private slot handling the switching of the 'user-site' mode.
on_verboseCheckBox_clicked | Private slot to handle a change of the verbose package information checkbox.

### Static Methods

None

#### PipPackagesWidget (Constructor)

PipPackagesWidget(pip, parent=None)

Constructor

pip (Pip)
  reference to the global pip interface
parent (QWidget)
  reference to the parent widget

#### PipPackagesWidget.__aboutToShowPipMenu

__aboutToShowPipMenu()

Private slot to set the action enabled status.

#### PipPackagesWidget.__allUpdateableItems

__allUpdateableItems()

Private method to get a list of all items that can be updated.

Returns:
  list of all items that can be updated

Return Type:
  list of QTreeWidgetItem

#### PipPackagesWidget.__editConfiguration

__editConfiguration(venvName="")

Private method to edit a configuration.

venvName (str)
  name of the environment to act upon

#### PipPackagesWidget.__editUserConfiguration

__editUserConfiguration()

Private slot to edit the user configuration.

#### PipPackagesWidget.__editVirtualenvConfiguration

__editVirtualenvConfiguration()

Private slot to edit the configuration of the selected environment.

#### PipPackagesWidget.__executeUpgradePackages

__executeUpgradePackages(packages)

Private method to execute the pip upgrade command.

packages (list of str)
  list of package names to be upgraded

Returns:
  flag indicating success

Return Type:
  bool

#### PipPackagesWidget.__finishSearch

__finishSearch()

Private slot performing the search finishing actions.

#### PipPackagesWidget.__generateRequirements

__generateRequirements()

Private slot to generate the contents for a requirements file.

#### PipPackagesWidget.__initPipMenu

__initPipMenu()

Private method to create the super menu and attach it to the super menu button.

#### PipPackagesWidget.__install

__install(userSite=False)

Private slot to install the selected packages.

userSite (bool)
  flag indicating to install to the user directory

#### PipPackagesWidget.__installLocalPackage

__installLocalPackage()

Private slot to install a package available on local storage.

#### PipPackagesWidget.__installPackages

__installPackages()

Private slot to install packages to be given by the user.

#### PipPackagesWidget.__installPip

__installPip()

Private slot to install pip into the selected environment.

#### PipPackagesWidget.__installPipUser

__installPipUser()

Private slot to install pip into the user site for the selected environment.

#### PipPackagesWidget.__installRequirements

__installRequirements()

Private slot to install packages as given in a requirements file.

#### PipPackagesWidget.__isPipAvailable

__isPipAvailable()

Private method to check, if the pip package is available for the selected environment.

Returns:
  flag indicating availability

Return Type:
  bool

#### PipPackagesWidget.__pipConfigure

__pipConfigure()

Private slot to open the configuration page.

#### PipPackagesWidget.__populateEnvironments

__populateEnvironments()

Private method to get a list of environments and populate the selector.

#### PipPackagesWidget.__processSearchResult

__processSearchResult(data)

Private method to process the search result data from PyPI.

data (tuple)
  result data with hits in the first element

#### PipPackagesWidget.__refreshPackagesList

__refreshPackagesList()

Private method to referesh the packages list.

#### PipPackagesWidget.__repairPip

__repairPip()

Private slot to repair the pip installation of the selected environment.

#### PipPackagesWidget.__score

__score(name, summary)

Private method to calculate some score for a search result.

name (str)
  name of the returned package
summary (str)
  summary text for the package

Returns:
  score value

Return Type:
  int

#### PipPackagesWidget.__search

__search()

Private method to perform the search.

#### PipPackagesWidget.__searchError

__searchError(errorCode, errorString)

Private method handling a search error.

errorCode (int)
  code of the error
errorString (str)
  error message

#### PipPackagesWidget.__selectedUpdateableItems

__selectedUpdateableItems()

Private method to get a list of selected items that can be updated.

Returns:
  list of selected items that can be updated

Return Type:
  list of QTreeWidgetItem

#### PipPackagesWidget.__showPackageDetails

__showPackageDetails(packageName, packageVersion)

Private method to populate the package details dialog.

packageName (str)
  name of the package to show details for
packageVersion (str)
  version of the package

#### PipPackagesWidget.__showSearchedDetails

__showSearchedDetails(item=None)

Private slot to show details about the selected search result package.

item (QTreeWidgetItem)
  reference to the search result item to show details for

#### PipPackagesWidget.__transformHits

__transformHits(hits)

Private method to convert the list returned from pypi into a packages list.

hits (list of dict)
  list returned from pypi

Returns:
  list of packages

Return Type:
  list of dict

#### PipPackagesWidget.__uninstallRequirements

__uninstallRequirements()

Private slot to uninstall packages as given in a requirements file.

#### PipPackagesWidget.__updateActionButtons

__updateActionButtons()

Private method to set the state of the action buttons.

#### PipPackagesWidget.__updateSearchActionButtons

__updateSearchActionButtons()

Private method to update the action button states of the search widget.

#### PipPackagesWidget.__updateSearchButton

__updateSearchButton()

Private method to update the state of the search button.

#### PipPackagesWidget.on_environmentsComboBox_currentIndexChanged

on_environmentsComboBox_currentIndexChanged(index)

Private slot handling the selection of a conda environment.

index (int)
  index of the selected conda environment

#### PipPackagesWidget.on_installButton_clicked

on_installButton_clicked()

Private slot to handle pressing the Install button..

#### PipPackagesWidget.on_installUserSiteButton_clicked

on_installUserSiteButton_clicked()

Private slot to handle pressing the Install to User-Site button..

#### PipPackagesWidget.on_installedFilesCheckBox_clicked

on_installedFilesCheckBox_clicked(checked)

Private slot to handle a change of the installed files information checkbox.

checked (bool)
  state of the checkbox

#### PipPackagesWidget.on_localCheckBox_clicked

on_localCheckBox_clicked(checked)

Private slot handling the switching of the local mode.

checked (bool)
  state of the local check box

#### PipPackagesWidget.on_notRequiredCheckBox_clicked

on_notRequiredCheckBox_clicked(checked)

Private slot handling the switching of the 'not required' mode.

checked (bool)
  state of the 'not required' check box

#### PipPackagesWidget.on_packagesList_itemActivated

on_packagesList_itemActivated(item, column)

Private slot reacting on a package item activation.

item (QTreeWidgetItem)
  reference to the activated item
column (int)
  activated column

#### PipPackagesWidget.on_packagesList_itemSelectionChanged

on_packagesList_itemSelectionChanged()

Private slot handling the selection of a package.

#### PipPackagesWidget.on_refreshButton_clicked

on_refreshButton_clicked()

Private slot to refresh the display.

#### PipPackagesWidget.on_searchButton_clicked

on_searchButton_clicked()

Private slot handling a press of the search button.

#### PipPackagesWidget.on_searchEditName_returnPressed

on_searchEditName_returnPressed()

Private slot initiating a search via a press of the Return key.

#### PipPackagesWidget.on_searchEditName_textChanged

on_searchEditName_textChanged(txt)

Private slot handling a change of the search term.

txt (str)
  search term

#### PipPackagesWidget.on_searchEditSummary_returnPressed

on_searchEditSummary_returnPressed()

Private slot initiating a search via a press of the Return key.

#### PipPackagesWidget.on_searchEditSummary_textChanged

on_searchEditSummary_textChanged(txt)

Private slot handling a change of the search term.

txt (str)
  search term

#### PipPackagesWidget.on_searchResultList_itemActivated

on_searchResultList_itemActivated(item, column)

Private slot reacting on an search result item activation.

item (QTreeWidgetItem)
  reference to the activated item
column (int)
  activated column

#### PipPackagesWidget.on_searchResultList_itemSelectionChanged

on_searchResultList_itemSelectionChanged()

Private slot handling changes of the search result selection.

#### PipPackagesWidget.on_searchToggleButton_toggled

on_searchToggleButton_toggled(checked)

Private slot to togle the search widget.

checked (bool)
  state of the search widget button

#### PipPackagesWidget.on_showDetailsButton_clicked

on_showDetailsButton_clicked()

Private slot to handle pressing the Show Details button.

#### PipPackagesWidget.on_showPackageDetailsButton_clicked

on_showPackageDetailsButton_clicked()

Private slot to show information for the selected package.

#### PipPackagesWidget.on_uninstallButton_clicked

on_uninstallButton_clicked()

Private slot to remove selected packages of the selected environment.

#### PipPackagesWidget.on_upgradeAllButton_clicked

on_upgradeAllButton_clicked()

Private slot to upgrade all packages of the selected environment.

#### PipPackagesWidget.on_upgradeButton_clicked

on_upgradeButton_clicked()

Private slot to upgrade selected packages of the selected environment.

#### PipPackagesWidget.on_userCheckBox_clicked

on_userCheckBox_clicked(checked)

Private slot handling the switching of the 'user-site' mode.

checked (bool)
  state of the 'user-site' check box

#### PipPackagesWidget.on_verboseCheckBox_clicked

on_verboseCheckBox_clicked(checked)

Private slot to handle a change of the verbose package information checkbox.

checked (bool)
  state of the checkbox

Up