# eric6.Plugins.UiExtensionPlugins.PipInterface.PipSearchDialog

Module implementing a dialog to search PyPI.

### Global Attributes

None

### Classes

PipSearchDialog | Class implementing a dialog to search PyPI.

### Functions

None

## PipSearchDialog

Class implementing a dialog to search PyPI.

### Derived from

QDialog, Ui_PipSearchDialog

### Class Attributes

Stopwords
VersionRole

### Class Methods

None

### Methods

PipSearchDialog | Constructor
__detailsError | Private method handling a details error.
__displayPackageDetails | Private method to display the returned package details.
__finish | Private slot performing the finishing actions.
__getPackageDownloadsData | Private method to store the details data and get downloads information.
__install | Private slot to install the selected packages.
__processSearchResult | Private method to process the search result data from PyPI.
__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.
__showDetails | Private slot to show details about the selected package.
__transformHits | Private method to convert the list returned from pypi into a packages list.
closeEvent | Protected slot implementing a close event handler.
on_buttonBox_clicked | Private slot called by a button of the button box clicked.
on_resultList_itemActivated | Private slot reacting on an item activation.
on_resultList_itemSelectionChanged | Private slot handling changes of the selection.
on_searchButton_clicked | Private slot handling a press of the search button.
on_searchEdit_textChanged | Private slot handling a change of the search term.

### Static Methods

None

#### PipSearchDialog (Constructor)

PipSearchDialog(pip, plugin, parent=None)

Constructor

pip
  reference to the master object (Pip)
plugin
  reference to the plugin object (ToolPipPlugin)
parent
  reference to the parent widget (QWidget)

#### PipSearchDialog.__detailsError

__detailsError(errorCode, errorString)

Private method handling a details error.

errorCode
  code of the error (integer)
errorString
  error message (string)

#### PipSearchDialog.__displayPackageDetails

__displayPackageDetails(data)

Private method to display the returned package details.

data
  result data (tuple) with downloads information in the first element

#### PipSearchDialog.__finish

__finish()

Private slot performing the finishing actions.

#### PipSearchDialog.__getPackageDownloadsData

__getPackageDownloadsData(packageVersion, data)

Private method to store the details data and get downloads information.

packageVersion (str)
  version info
data (tuple)
  result data with package details in the first element

#### PipSearchDialog.__install

__install()

Private slot to install the selected packages.

#### PipSearchDialog.__processSearchResult

__processSearchResult(data)

Private method to process the search result data from PyPI.

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

#### PipSearchDialog.__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

#### PipSearchDialog.__search

__search()

Private method to perform the search.

#### PipSearchDialog.__searchError

__searchError(errorCode, errorString)

Private method handling a search error.

errorCode
  code of the error (integer)
errorString
  error message (string)

#### PipSearchDialog.__showDetails

__showDetails()

Private slot to show details about the selected package.

#### PipSearchDialog.__transformHits

__transformHits(hits)

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

hits
  list returned from pypi (list of dict)

Returns:
  list of packages (list of dict)

#### PipSearchDialog.closeEvent

closeEvent(e)

Protected slot implementing a close event handler.

e
  close event (QCloseEvent)

#### PipSearchDialog.on_buttonBox_clicked

on_buttonBox_clicked(button)

Private slot called by a button of the button box clicked.

button
  button that was clicked (QAbstractButton)

#### PipSearchDialog.on_resultList_itemActivated

on_resultList_itemActivated(item, column)

Private slot reacting on an item activation.

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

#### PipSearchDialog.on_resultList_itemSelectionChanged

on_resultList_itemSelectionChanged()

Private slot handling changes of the selection.

#### PipSearchDialog.on_searchButton_clicked

on_searchButton_clicked()

Private slot handling a press of the search button.

#### PipSearchDialog.on_searchEdit_textChanged

on_searchEdit_textChanged(txt)

Private slot handling a change of the search term.

txt
  search term (string)

Up