eric6/PipInterface/PipPackagesWidget.py

Sat, 27 Feb 2021 12:08:23 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 27 Feb 2021 12:08:23 +0100
changeset 8138
169e65a6787c
parent 8090
c53117374255
child 8143
2c730d5fd177
permissions
-rw-r--r--

Shell: added functionality to show a prompt when the main client process has exited (e.g. a script ended).

6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7905
diff changeset
3 # Copyright (c) 2019 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the pip packages management widget.
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
10 import textwrap
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
11 import os
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
12 import html.parser
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
13
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
14 from PyQt5.QtCore import pyqtSlot, Qt, QUrl, QUrlQuery
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
15 from PyQt5.QtNetwork import QNetworkReply, QNetworkRequest
7255
d595f6f9cbf8 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7241
diff changeset
16 from PyQt5.QtWidgets import (
d595f6f9cbf8 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7241
diff changeset
17 QWidget, QToolButton, QApplication, QHeaderView, QTreeWidgetItem,
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
18 QMenu, QDialog
7255
d595f6f9cbf8 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7241
diff changeset
19 )
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
20
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
21 from E5Gui.E5Application import e5App
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
22 from E5Gui import E5MessageBox
7771
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
23 from E5Gui.E5OverrideCursor import E5OverrideCursor
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
24
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 from .Ui_PipPackagesWidget import Ui_PipPackagesWidget
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 import UI.PixmapCache
7641
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
28 import Globals
7726
b1ade4fcf05f Pip Interface: added an option to not show 'conda' managed environments in the selector.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7641
diff changeset
29 import Preferences
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
32 class PypiSearchResultsParser(html.parser.HTMLParser):
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
33 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
34 Class implementing the parser for the PyPI search result page.
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
35 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
36 ClassPrefix = "package-snippet__"
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
37
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
38 def __init__(self, data):
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
39 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
40 Constructor
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
41
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
42 @param data data to be parsed
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
43 @type str
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
44 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
45 super(PypiSearchResultsParser, self).__init__()
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
46 self.__results = []
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
47 self.__activeClass = None
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
48 self.feed(data)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
49
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
50 def __getClass(self, attrs):
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
51 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
52 Private method to extract the class attribute out of the list of
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
53 attributes.
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
54
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
55 @param attrs list of tag attributes as (name, value) tuples
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
56 @type list of tuple of (str, str)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
57 @return value of the 'class' attribute or None
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
58 @rtype str
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
59 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
60 for name, value in attrs:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
61 if name == "class":
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
62 return value
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
63
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
64 return None
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
65
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
66 def __getDate(self, attrs):
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
67 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
68 Private method to extract the datetime attribute out of the list of
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
69 attributes and process it.
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
70
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
71 @param attrs list of tag attributes as (name, value) tuples
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
72 @type list of tuple of (str, str)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
73 @return value of the 'class' attribute or None
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
74 @rtype str
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
75 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
76 for name, value in attrs:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
77 if name == "datetime":
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
78 return value.split("T")[0]
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
79
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
80 return None
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
81
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
82 def handle_starttag(self, tag, attrs):
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
83 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
84 Public method to process the start tag.
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
85
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
86 @param tag tag name (all lowercase)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
87 @type str
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
88 @param attrs list of tag attributes as (name, value) tuples
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
89 @type list of tuple of (str, str)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
90 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
91 if tag == "a" and self.__getClass(attrs) == "package-snippet":
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
92 self.__results.append({})
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
93
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
94 if tag in ("span", "p"):
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
95 tagClass = self.__getClass(attrs)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
96 if tagClass in (
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
97 "package-snippet__name", "package-snippet__description",
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
98 "package-snippet__version", "package-snippet__released",
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
99 ):
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
100 self.__activeClass = tagClass
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
101 else:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
102 self.__activeClass = None
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
103 elif tag == "time":
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
104 attributeName = self.__activeClass.replace(self.ClassPrefix, "")
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
105 self.__results[-1][attributeName] = self.__getDate(attrs)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
106 self.__activeClass = None
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
107 else:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
108 self.__activeClass = None
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
109
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
110 def handle_data(self, data):
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
111 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
112 Public method process arbitrary data.
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
113
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
114 @param data data to be processed
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
115 @type str
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
116 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
117 if self.__activeClass is not None:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
118 attributeName = self.__activeClass.replace(self.ClassPrefix, "")
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
119 self.__results[-1][attributeName] = data
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
120
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
121 def handle_endtag(self, tag):
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
122 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
123 Public method to process the end tag.
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
124
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
125 @param tag tag name (all lowercase)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
126 @type str
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
127 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
128 self.__activeClass = None
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
129
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
130 def getResults(self):
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
131 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
132 Public method to get the extracted search results.
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
133
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
134 @return extracted result data
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
135 @rtype list of dict
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
136 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
137 return self.__results
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
138
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
139
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 class PipPackagesWidget(QWidget, Ui_PipPackagesWidget):
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141 """
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
142 Class implementing the pip packages management widget.
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 """
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
144 ShowProcessGeneralMode = 0
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
145 ShowProcessClassifiersMode = 1
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
146 ShowProcessEntryPointsMode = 2
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
147 ShowProcessFilesListMode = 3
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
148
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
149 SearchVersionRole = Qt.UserRole + 1
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
150
6828
bb6667ea9ae7 Changed the Google Mail interface to not use obsoleted packages anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6806
diff changeset
151 def __init__(self, pip, parent=None):
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 """
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 Constructor
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154
6828
bb6667ea9ae7 Changed the Google Mail interface to not use obsoleted packages anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6806
diff changeset
155 @param pip reference to the global pip interface
bb6667ea9ae7 Changed the Google Mail interface to not use obsoleted packages anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6806
diff changeset
156 @type Pip
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 @param parent reference to the parent widget
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 @type QWidget
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 """
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160 super(PipPackagesWidget, self).__init__(parent)
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 self.setupUi(self)
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 self.pipMenuButton.setObjectName(
7107
fccf607a5326 CondaPackagesWidget, PipPackagesWidget: fixed a little issue related to naming some Qt objects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7063
diff changeset
164 "pip_supermenu_button")
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 self.pipMenuButton.setIcon(UI.PixmapCache.getIcon("superMenu"))
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 self.pipMenuButton.setToolTip(self.tr("pip Menu"))
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167 self.pipMenuButton.setPopupMode(QToolButton.InstantPopup)
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 self.pipMenuButton.setToolButtonStyle(Qt.ToolButtonIconOnly)
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169 self.pipMenuButton.setFocusPolicy(Qt.NoFocus)
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 self.pipMenuButton.setAutoRaise(True)
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 self.pipMenuButton.setShowMenuInside(True)
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172
6804
dc20bde4af90 PipPackagesWidget: converted the verbal action buttons to iconic ones.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6801
diff changeset
173 self.refreshButton.setIcon(UI.PixmapCache.getIcon("reload"))
dc20bde4af90 PipPackagesWidget: converted the verbal action buttons to iconic ones.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6801
diff changeset
174 self.upgradeButton.setIcon(UI.PixmapCache.getIcon("1uparrow"))
dc20bde4af90 PipPackagesWidget: converted the verbal action buttons to iconic ones.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6801
diff changeset
175 self.upgradeAllButton.setIcon(UI.PixmapCache.getIcon("2uparrow"))
dc20bde4af90 PipPackagesWidget: converted the verbal action buttons to iconic ones.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6801
diff changeset
176 self.uninstallButton.setIcon(UI.PixmapCache.getIcon("minus"))
dc20bde4af90 PipPackagesWidget: converted the verbal action buttons to iconic ones.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6801
diff changeset
177 self.showPackageDetailsButton.setIcon(UI.PixmapCache.getIcon("info"))
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 self.searchToggleButton.setIcon(UI.PixmapCache.getIcon("find"))
6804
dc20bde4af90 PipPackagesWidget: converted the verbal action buttons to iconic ones.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6801
diff changeset
179 self.searchButton.setIcon(UI.PixmapCache.getIcon("findNext"))
dc20bde4af90 PipPackagesWidget: converted the verbal action buttons to iconic ones.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6801
diff changeset
180 self.installButton.setIcon(UI.PixmapCache.getIcon("plus"))
dc20bde4af90 PipPackagesWidget: converted the verbal action buttons to iconic ones.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6801
diff changeset
181 self.installUserSiteButton.setIcon(UI.PixmapCache.getIcon("addUser"))
dc20bde4af90 PipPackagesWidget: converted the verbal action buttons to iconic ones.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6801
diff changeset
182 self.showDetailsButton.setIcon(UI.PixmapCache.getIcon("info"))
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183
6828
bb6667ea9ae7 Changed the Google Mail interface to not use obsoleted packages anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6806
diff changeset
184 self.__pip = pip
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
186 self.packagesList.header().setSortIndicator(0, Qt.AscendingOrder)
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
187
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
188 self.__infoLabels = {
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
189 "name": self.tr("Name:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
190 "version": self.tr("Version:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
191 "location": self.tr("Location:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
192 "requires": self.tr("Requires:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
193 "summary": self.tr("Summary:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
194 "home-page": self.tr("Homepage:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
195 "author": self.tr("Author:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
196 "author-email": self.tr("Author Email:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
197 "license": self.tr("License:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
198 "metadata-version": self.tr("Metadata Version:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
199 "installer": self.tr("Installer:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
200 "classifiers": self.tr("Classifiers:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
201 "entry-points": self.tr("Entry Points:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
202 "files": self.tr("Files:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
203 }
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
204 self.infoWidget.setHeaderLabels(["Key", "Value"])
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
205
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
206 venvManager = e5App().getObject("VirtualEnvManager")
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
207 venvManager.virtualEnvironmentAdded.connect(
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
208 self.on_refreshButton_clicked)
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
209 venvManager.virtualEnvironmentRemoved.connect(
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
210 self.on_refreshButton_clicked)
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
211
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
212 project = e5App().getObject("Project")
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
213 project.projectOpened.connect(
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
214 self.on_refreshButton_clicked)
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
215 project.projectClosed.connect(
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
216 self.on_refreshButton_clicked)
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
217
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
218 self.__initPipMenu()
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
219 self.__populateEnvironments()
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
220 self.__updateActionButtons()
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
221
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222 self.statusLabel.hide()
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223 self.searchWidget.hide()
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
224
6798
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
225 self.__queryName = []
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
226 self.__querySummary = []
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
227
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
228 self.__replies = []
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
229
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
230 self.__packageDetailsDialog = None
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232 def __populateEnvironments(self):
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
233 """
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234 Private method to get a list of environments and populate the selector.
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235 """
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
236 self.environmentsComboBox.addItem("")
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
237 projectVenv = self.__pip.getProjectEnvironmentString()
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 if projectVenv:
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 self.environmentsComboBox.addItem(projectVenv)
6975
3325bf3e7b2c Pip, PipPackagesWidget, VirtualenvManager: fixed an issue causing environments for remote debugging being shown in the selection list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
240 self.environmentsComboBox.addItems(
7726
b1ade4fcf05f Pip Interface: added an option to not show 'conda' managed environments in the selector.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7641
diff changeset
241 self.__pip.getVirtualenvNames(
b1ade4fcf05f Pip Interface: added an option to not show 'conda' managed environments in the selector.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7641
diff changeset
242 noRemote=True,
b1ade4fcf05f Pip Interface: added an option to not show 'conda' managed environments in the selector.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7641
diff changeset
243 noConda=Preferences.getPip("ExcludeCondaEnvironments")
b1ade4fcf05f Pip Interface: added an option to not show 'conda' managed environments in the selector.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7641
diff changeset
244 )
b1ade4fcf05f Pip Interface: added an option to not show 'conda' managed environments in the selector.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7641
diff changeset
245 )
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
246
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
247 def __isPipAvailable(self):
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
248 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
249 Private method to check, if the pip package is available for the
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
250 selected environment.
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
251
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
252 @return flag indicating availability
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
253 @rtype bool
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
254 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
255 available = False
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
256
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
257 venvName = self.environmentsComboBox.currentText()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
258 if venvName:
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
259 available = len(self.packagesList.findItems(
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
260 "pip", Qt.MatchExactly | Qt.MatchCaseSensitive)) == 1
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
261
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
262 return available
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
263
7641
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
264 def __availablePipVersion(self):
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
265 """
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
266 Private method to get the pip version of the selected environment.
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
267
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
268 @return tuple containing the version number or tuple with all zeros
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
269 in case pip is not available
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
270 @rtype tuple of int
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
271 """
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
272 pipVersionTuple = (0, 0, 0)
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
273 venvName = self.environmentsComboBox.currentText()
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
274 if venvName:
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
275 pipList = self.packagesList.findItems(
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
276 "pip", Qt.MatchExactly | Qt.MatchCaseSensitive)
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
277 if len(pipList) > 0:
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
278 pipVersionTuple = Globals.versionToTuple(pipList[0].text(1))
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
279
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
280 return pipVersionTuple
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
281
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
282 def getPip(self):
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
283 """
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
284 Public method to get a reference to the pip interface object.
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
285
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
286 @return reference to the pip interface object
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
287 @rtype Pip
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
288 """
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
289 return self.__pip
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
290
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
291 #######################################################################
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
292 ## Slots handling widget signals below
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
293 #######################################################################
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
294
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
295 def __selectedUpdateableItems(self):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
296 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
297 Private method to get a list of selected items that can be updated.
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
298
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
299 @return list of selected items that can be updated
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
300 @rtype list of QTreeWidgetItem
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
301 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
302 return [
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
303 itm for itm in self.packagesList.selectedItems()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
304 if bool(itm.text(2))
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
305 ]
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
306
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
307 def __allUpdateableItems(self):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
308 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
309 Private method to get a list of all items that can be updated.
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
310
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
311 @return list of all items that can be updated
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
312 @rtype list of QTreeWidgetItem
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
313 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
314 updateableItems = []
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
315 for index in range(self.packagesList.topLevelItemCount()):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
316 itm = self.packagesList.topLevelItem(index)
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
317 if itm.text(2):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
318 updateableItems.append(itm)
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
319
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
320 return updateableItems
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
321
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322 def __updateActionButtons(self):
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323 """
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
324 Private method to set the state of the action buttons.
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
325 """
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
326 if self.__isPipAvailable():
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
327 self.upgradeButton.setEnabled(
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
328 bool(self.__selectedUpdateableItems()))
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
329 self.uninstallButton.setEnabled(
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
330 bool(self.packagesList.selectedItems()))
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
331 self.upgradeAllButton.setEnabled(
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
332 bool(self.__allUpdateableItems()))
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
333 self.showPackageDetailsButton.setEnabled(
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
334 len(self.packagesList.selectedItems()) == 1)
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
335 else:
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
336 self.upgradeButton.setEnabled(False)
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
337 self.uninstallButton.setEnabled(False)
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
338 self.upgradeAllButton.setEnabled(False)
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
339 self.showPackageDetailsButton.setEnabled(False)
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
340
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
341 def __refreshPackagesList(self):
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
342 """
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
343 Private method to referesh the packages list.
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
344 """
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
345 self.packagesList.clear()
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
346 venvName = self.environmentsComboBox.currentText()
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
347 if venvName:
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
348 interpreter = self.__pip.getVirtualenvInterpreter(venvName)
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
349 if interpreter:
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
350 self.statusLabel.show()
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
351 self.statusLabel.setText(
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
352 self.tr("Getting installed packages..."))
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
353
7771
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
354 with E5OverrideCursor():
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
355 # 1. populate with installed packages
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
356 self.packagesList.setUpdatesEnabled(False)
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
357 installedPackages = self.__pip.getInstalledPackages(
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
358 venvName,
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
359 localPackages=self.localCheckBox.isChecked(),
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
360 notRequired=self.notRequiredCheckBox.isChecked(),
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
361 usersite=self.userCheckBox.isChecked(),
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
362 )
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
363 for package, version in installedPackages:
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
364 QTreeWidgetItem(self.packagesList, [package, version])
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
365 self.packagesList.setUpdatesEnabled(True)
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
366 self.statusLabel.setText(
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
367 self.tr("Getting outdated packages..."))
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
368 QApplication.processEvents()
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
369
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
370 # 2. update with update information
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
371 self.packagesList.setUpdatesEnabled(False)
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
372 outdatedPackages = self.__pip.getOutdatedPackages(
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
373 venvName,
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
374 localPackages=self.localCheckBox.isChecked(),
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
375 notRequired=self.notRequiredCheckBox.isChecked(),
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
376 usersite=self.userCheckBox.isChecked(),
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
377 )
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
378 for package, _version, latest in outdatedPackages:
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
379 items = self.packagesList.findItems(
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
380 package, Qt.MatchExactly | Qt.MatchCaseSensitive)
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
381 if items:
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
382 itm = items[0]
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
383 itm.setText(2, latest)
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
384
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
385 self.packagesList.sortItems(0, Qt.AscendingOrder)
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
386 for col in range(self.packagesList.columnCount()):
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
387 self.packagesList.resizeColumnToContents(col)
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
388 self.packagesList.setUpdatesEnabled(True)
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
389 self.statusLabel.hide()
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
390
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
391 self.__updateActionButtons()
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
392 self.__updateSearchActionButtons()
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
393 self.__updateSearchButton()
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
394
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
395 @pyqtSlot(int)
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
396 def on_environmentsComboBox_currentIndexChanged(self, index):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
397 """
7241
0c0c9015c40f PipPackagesWidget: corrected a copy & paste issue in a source docu string.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
398 Private slot handling the selection of a Python environment.
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
399
7241
0c0c9015c40f PipPackagesWidget: corrected a copy & paste issue in a source docu string.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
400 @param index index of the selected Python environment
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
401 @type int
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
402 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
403 self.__refreshPackagesList()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
404
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
405 @pyqtSlot(bool)
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
406 def on_localCheckBox_clicked(self, checked):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
407 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
408 Private slot handling the switching of the local mode.
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
409
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
410 @param checked state of the local check box
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
411 @type bool
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
412 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
413 self.__refreshPackagesList()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
414
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
415 @pyqtSlot(bool)
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
416 def on_notRequiredCheckBox_clicked(self, checked):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
417 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
418 Private slot handling the switching of the 'not required' mode.
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
419
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
420 @param checked state of the 'not required' check box
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
421 @type bool
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
422 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
423 self.__refreshPackagesList()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
424
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
425 @pyqtSlot(bool)
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
426 def on_userCheckBox_clicked(self, checked):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
427 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
428 Private slot handling the switching of the 'user-site' mode.
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
429
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
430 @param checked state of the 'user-site' check box
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
431 @type bool
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
432 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
433 self.__refreshPackagesList()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
434
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
435 @pyqtSlot()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
436 def on_packagesList_itemSelectionChanged(self):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
437 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
438 Private slot handling the selection of a package.
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
439 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
440 self.infoWidget.clear()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
441
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
442 if len(self.packagesList.selectedItems()) == 1:
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
443 itm = self.packagesList.selectedItems()[0]
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
444
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
445 environment = self.environmentsComboBox.currentText()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
446 interpreter = self.__pip.getVirtualenvInterpreter(environment)
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
447 if not interpreter:
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
448 return
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
449
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
450 args = ["-m", "pip", "show"]
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
451 if self.verboseCheckBox.isChecked():
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
452 args.append("--verbose")
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
453 if self.installedFilesCheckBox.isChecked():
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
454 args.append("--files")
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
455 args.append(itm.text(0))
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
456
7771
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
457 with E5OverrideCursor():
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
458 success, output = self.__pip.runProcess(args, interpreter)
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
459
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
460 if success and output:
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
461 mode = self.ShowProcessGeneralMode
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
462 for line in output.splitlines():
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
463 line = line.rstrip()
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
464 if line != "---":
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
465 if mode != self.ShowProcessGeneralMode:
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
466 if line[0] == " ":
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
467 QTreeWidgetItem(
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
468 self.infoWidget,
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
469 [" ", line.strip()])
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
470 else:
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
471 mode = self.ShowProcessGeneralMode
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
472 if mode == self.ShowProcessGeneralMode:
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
473 try:
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
474 label, info = line.split(": ", 1)
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
475 except ValueError:
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
476 label = line[:-1]
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
477 info = ""
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
478 label = label.lower()
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
479 if label in self.__infoLabels:
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
480 QTreeWidgetItem(
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
481 self.infoWidget,
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
482 [self.__infoLabels[label], info])
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
483 if label == "files":
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
484 mode = self.ShowProcessFilesListMode
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
485 elif label == "classifiers":
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
486 mode = self.ShowProcessClassifiersMode
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
487 elif label == "entry-points":
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
488 mode = self.ShowProcessEntryPointsMode
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
489 self.infoWidget.scrollToTop()
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
490
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
491 header = self.infoWidget.header()
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
492 header.setStretchLastSection(False)
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
493 header.resizeSections(QHeaderView.ResizeToContents)
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
494 if (
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
495 header.sectionSize(0) + header.sectionSize(1) <
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
496 header.width()
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
497 ):
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
498 header.setStretchLastSection(True)
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
499
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
500 self.__updateActionButtons()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
501
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
502 @pyqtSlot(QTreeWidgetItem, int)
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
503 def on_packagesList_itemActivated(self, item, column):
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
504 """
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
505 Private slot reacting on a package item activation.
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
506
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
507 @param item reference to the activated item
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
508 @type QTreeWidgetItem
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
509 @param column activated column
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
510 @type int
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
511 """
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
512 packageName = item.text(0)
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
513 upgradable = bool(item.text(2))
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
514 if column == 1:
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
515 # show details for installed version
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
516 packageVersion = item.text(1)
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
517 else:
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
518 # show details for available version or installed one
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
519 if item.text(2):
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
520 packageVersion = item.text(2)
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
521 else:
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
522 packageVersion = item.text(1)
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
523
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
524 self.__showPackageDetails(packageName, packageVersion,
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
525 upgradable=upgradable)
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
526
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
527 @pyqtSlot(bool)
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
528 def on_verboseCheckBox_clicked(self, checked):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
529 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
530 Private slot to handle a change of the verbose package information
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
531 checkbox.
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
532
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
533 @param checked state of the checkbox
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
534 @type bool
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
535 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
536 self.on_packagesList_itemSelectionChanged()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
537
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
538 @pyqtSlot(bool)
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
539 def on_installedFilesCheckBox_clicked(self, checked):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
540 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
541 Private slot to handle a change of the installed files information
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
542 checkbox.
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
543
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
544 @param checked state of the checkbox
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
545 @type bool
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
546 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
547 self.on_packagesList_itemSelectionChanged()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
548
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
549 @pyqtSlot()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
550 def on_refreshButton_clicked(self):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
551 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
552 Private slot to refresh the display.
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
553 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
554 currentEnvironment = self.environmentsComboBox.currentText()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
555 self.environmentsComboBox.clear()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
556 self.packagesList.clear()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
557
7771
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
558 with E5OverrideCursor():
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
559 self.__populateEnvironments()
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
560
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
561 index = self.environmentsComboBox.findText(
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
562 currentEnvironment, Qt.MatchExactly | Qt.MatchCaseSensitive)
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
563 if index != -1:
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
564 self.environmentsComboBox.setCurrentIndex(index)
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
565
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
566 self.__updateActionButtons()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
567
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
568 @pyqtSlot()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
569 def on_upgradeButton_clicked(self):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
570 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
571 Private slot to upgrade selected packages of the selected environment.
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
572 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
573 packages = [itm.text(0) for itm in self.__selectedUpdateableItems()]
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
574 if packages:
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
575 self.executeUpgradePackages(packages)
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
576
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
577 @pyqtSlot()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
578 def on_upgradeAllButton_clicked(self):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
579 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
580 Private slot to upgrade all packages of the selected environment.
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
581 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
582 packages = [itm.text(0) for itm in self.__allUpdateableItems()]
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
583 if packages:
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
584 self.executeUpgradePackages(packages)
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
585
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
586 @pyqtSlot()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
587 def on_uninstallButton_clicked(self):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
588 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
589 Private slot to remove selected packages of the selected environment.
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
590 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
591 packages = [itm.text(0) for itm in self.packagesList.selectedItems()]
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
592 self.executeUninstallPackages(packages)
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
593
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
594 def executeUninstallPackages(self, packages):
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
595 """
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
596 Public method to uninstall the given list of packages.
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
597
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
598 @param packages list of package names to be uninstalled
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
599 @type list of str
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
600 """
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
601 if packages:
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
602 ok = self.__pip.uninstallPackages(
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
603 packages,
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
604 venvName=self.environmentsComboBox.currentText())
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
605 if ok:
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
606 self.on_refreshButton_clicked()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
607
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
608 def executeUpgradePackages(self, packages):
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
609 """
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
610 Public method to execute the pip upgrade command.
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
611
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
612 @param packages list of package names to be upgraded
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
613 @type list of str
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
614 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
615 ok = self.__pip.upgradePackages(
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
616 packages, venvName=self.environmentsComboBox.currentText(),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
617 userSite=self.userCheckBox.isChecked())
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
618 if ok:
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
619 self.on_refreshButton_clicked()
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
620
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
621 @pyqtSlot()
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
622 def on_showPackageDetailsButton_clicked(self):
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
623 """
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
624 Private slot to show information for the selected package.
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
625 """
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
626 item = self.packagesList.selectedItems()[0]
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
627 if item:
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
628 packageName = item.text(0)
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
629 upgradable = bool(item.text(2))
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
630 # show details for available version or installed one
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
631 if item.text(2):
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
632 packageVersion = item.text(2)
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
633 else:
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
634 packageVersion = item.text(1)
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
635
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
636 self.__showPackageDetails(packageName, packageVersion,
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
637 upgradable=upgradable)
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
638
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
639 #######################################################################
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
640 ## Search widget related methods below
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
641 #######################################################################
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
642
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
643 def __updateSearchActionButtons(self):
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
644 """
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
645 Private method to update the action button states of the search widget.
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
646 """
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
647 installEnable = (
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
648 len(self.searchResultList.selectedItems()) > 0 and
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
649 self.environmentsComboBox.currentIndex() > 0 and
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
650 self.__isPipAvailable()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
651 )
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
652 self.installButton.setEnabled(installEnable)
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
653 self.installUserSiteButton.setEnabled(installEnable)
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
654
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
655 self.showDetailsButton.setEnabled(
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
656 len(self.searchResultList.selectedItems()) == 1 and
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
657 self.__isPipAvailable()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
658 )
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
659
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
660 def __updateSearchButton(self):
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
661 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
662 Private method to update the state of the search button.
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
663 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
664 self.searchButton.setEnabled(
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
665 bool(self.searchEditName.text()) and
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
666 self.__isPipAvailable()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
667 )
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
668
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
669 @pyqtSlot(bool)
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
670 def on_searchToggleButton_toggled(self, checked):
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
671 """
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
672 Private slot to togle the search widget.
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
673
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
674 @param checked state of the search widget button
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
675 @type bool
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
676 """
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
677 self.searchWidget.setVisible(checked)
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
678
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
679 if checked:
6798
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
680 self.searchEditName.setFocus(Qt.OtherFocusReason)
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
681 self.searchEditName.selectAll()
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
682
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
683 self.__updateSearchActionButtons()
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
684 self.__updateSearchButton()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
685
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
686 @pyqtSlot(str)
6798
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
687 def on_searchEditName_textChanged(self, txt):
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
688 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
689 Private slot handling a change of the search term.
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
690
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
691 @param txt search term
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
692 @type str
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
693 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
694 self.__updateSearchButton()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
695
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
696 @pyqtSlot()
6798
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
697 def on_searchEditName_returnPressed(self):
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
698 """
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
699 Private slot initiating a search via a press of the Return key.
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
700 """
7477
98058d3ba634 PipPackagesWidget: fixed a bug related to searching PyPI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
701 if (
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
702 bool(self.searchEditName.text()) and
7477
98058d3ba634 PipPackagesWidget: fixed a bug related to searching PyPI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
703 self.__isPipAvailable()
98058d3ba634 PipPackagesWidget: fixed a bug related to searching PyPI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
704 ):
98058d3ba634 PipPackagesWidget: fixed a bug related to searching PyPI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
705 self.__search()
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
706
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
707 @pyqtSlot()
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
708 def on_searchButton_clicked(self):
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
709 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
710 Private slot handling a press of the search button.
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
711 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
712 self.__search()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
713
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
714 @pyqtSlot()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
715 def on_searchResultList_itemSelectionChanged(self):
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
716 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
717 Private slot handling changes of the search result selection.
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
718 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
719 self.__updateSearchActionButtons()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
720
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
721 def __search(self):
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
722 """
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
723 Private method to perform the search by calling the PyPI search URL.
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
724 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
725 self.searchResultList.clear()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
726 self.searchInfoLabel.clear()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
727
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
728 self.searchButton.setEnabled(False)
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
729
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
730 searchTerm = self.searchEditName.text().strip()
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
731 searchTerm = bytes(QUrl.toPercentEncoding(searchTerm)).decode()
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
732 urlQuery = QUrlQuery()
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
733 urlQuery.addQueryItem("q", searchTerm)
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
734 url = QUrl(self.__pip.getIndexUrlSearch())
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
735 url.setQuery(urlQuery)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
736
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
737 request = QNetworkRequest(QUrl(url))
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
738 request.setAttribute(QNetworkRequest.CacheLoadControlAttribute,
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
739 QNetworkRequest.AlwaysNetwork)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
740 reply = self.__pip.getNetworkAccessManager().get(request)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
741 reply.finished.connect(
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
742 lambda: self.__searchResponse(reply))
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
743 self.__replies.append(reply)
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
744
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
745 def __searchResponse(self, reply):
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
746 """
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
747 Private method to extract the search result data from the response.
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
748
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
749 @param reply reference to the reply object containing the data
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
750 @type QNetworkReply
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
751 """
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
752 if reply in self.__replies:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
753 self.__replies.remove(reply)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
754
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
755 urlQuery = QUrlQuery(reply.url())
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
756 searchTerm = urlQuery.queryItemValue("q")
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
757
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
758 if reply.error() != QNetworkReply.NoError:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
759 E5MessageBox.warning(
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
760 None,
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
761 self.tr("Search PyPI"),
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
762 self.tr(
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
763 "<p>Received an error while searching for <b>{0}</b>.</p>"
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
764 "<p>Error: {1}</p>"
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
765 ).format(searchTerm, reply.errorString())
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
766 )
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
767 reply.deleteLater()
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
768 return
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
769
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
770 data = bytes(reply.readAll()).decode()
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
771 reply.deleteLater()
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
772
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
773 results = PypiSearchResultsParser(data).getResults()
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
774 if results:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
775 if len(results) < 20:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
776 msg = self.tr("%n package(s) found.", "", len(results))
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
777 else:
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
778 msg = self.tr("Showing first 20 packages found.")
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
779 self.searchInfoLabel.setText(msg)
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
780 else:
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
781 E5MessageBox.warning(
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
782 self,
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
783 self.tr("Search PyPI"),
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
784 self.tr("""<p>There were no results for <b>{0}</b>.</p>"""))
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
785 self.searchInfoLabel.setText(
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
786 self.tr("""<p>There were no results for <b>{0}</b>.</p>"""))
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
787
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
788 wrapper = textwrap.TextWrapper(width=80)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
789 for result in results:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
790 try:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
791 description = "\n".join([
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
792 wrapper.fill(line) for line in
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
793 result['description'].strip().splitlines()
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
794 ])
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
795 except KeyError:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
796 description = ""
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
797 itm = QTreeWidgetItem(
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
798 self.searchResultList, [
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
799 result['name'].strip(),
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
800 result['version'],
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
801 result["released"].strip(),
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
802 description,
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
803 ])
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
804 itm.setData(0, self.SearchVersionRole, result['version'])
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
805
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
806 header = self.searchResultList.header()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
807 header.setStretchLastSection(False)
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
808 header.resizeSections(QHeaderView.ResizeToContents)
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
809 headerSize = 0
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
810 for col in range(header.count()):
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
811 headerSize += header.sectionSize(col)
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
812 if headerSize < header.width():
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
813 header.setStretchLastSection(True)
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
814
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
815 self.__finishSearch()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
816
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
817 def __finishSearch(self):
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
818 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
819 Private slot performing the search finishing actions.
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
820 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
821 self.__updateSearchActionButtons()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
822 self.__updateSearchButton()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
823
6798
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
824 self.searchEditName.setFocus(Qt.OtherFocusReason)
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
825
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
826 @pyqtSlot()
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
827 def on_installButton_clicked(self):
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
828 """
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
829 Private slot to handle pressing the Install button..
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
830 """
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
831 packages = [
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
832 itm.text(0).strip()
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
833 for itm in self.searchResultList.selectedItems()
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
834 ]
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
835 self.executeInstallPackages(packages)
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
836
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
837 @pyqtSlot()
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
838 def on_installUserSiteButton_clicked(self):
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
839 """
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
840 Private slot to handle pressing the Install to User-Site button..
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
841 """
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
842 packages = [
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
843 itm.text(0).strip()
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
844 for itm in self.searchResultList.selectedItems()
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
845 ]
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
846 self.executeInstallPackages(packages, userSite=True)
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
847
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
848 def executeInstallPackages(self, packages, userSite=False):
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
849 """
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
850 Public method to install the given list of packages.
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
851
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
852 @param packages list of package names to be installed
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
853 @type list of str
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
854 @param userSite flag indicating to install to the user directory
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
855 @type bool
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
856 """
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
857 venvName = self.environmentsComboBox.currentText()
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
858 if venvName and packages:
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
859 self.__pip.installPackages(packages, venvName=venvName,
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
860 userSite=userSite)
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
861 self.on_refreshButton_clicked()
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
862
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
863 @pyqtSlot()
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
864 def on_showDetailsButton_clicked(self):
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
865 """
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
866 Private slot to handle pressing the Show Details button.
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
867 """
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
868 self.__showSearchedDetails()
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
869
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
870 @pyqtSlot(QTreeWidgetItem, int)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
871 def on_searchResultList_itemActivated(self, item, column):
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
872 """
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
873 Private slot reacting on an search result item activation.
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
874
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
875 @param item reference to the activated item
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
876 @type QTreeWidgetItem
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
877 @param column activated column
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
878 @type int
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
879 """
7063
2bea77c643a0 PipPackagesWidget: fixed an issue caused by a wrong method call.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6975
diff changeset
880 self.__showSearchedDetails(item)
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
881
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
882 def __showSearchedDetails(self, item=None):
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
883 """
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
884 Private slot to show details about the selected search result package.
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
885
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
886 @param item reference to the search result item to show details for
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
887 @type QTreeWidgetItem
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
888 """
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
889 self.showDetailsButton.setEnabled(False)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
890
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
891 if not item:
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
892 item = self.searchResultList.selectedItems()[0]
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
893
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
894 packageVersion = item.data(0, self.SearchVersionRole)
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
895 packageName = item.text(0)
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
896
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
897 self.__showPackageDetails(packageName, packageVersion,
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
898 installable=True)
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
899
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
900 def __showPackageDetails(self, packageName, packageVersion,
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
901 upgradable=False, installable=False):
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
902 """
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
903 Private method to populate the package details dialog.
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
904
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
905 @param packageName name of the package to show details for
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
906 @type str
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
907 @param packageVersion version of the package
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
908 @type str
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
909 @param upgradable flag indicating that the package may be upgraded
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
910 (defaults to False)
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
911 @type bool (optional)
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
912 @param installable flag indicating that the package may be installed
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
913 (defaults to False)
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
914 @type bool (optional)
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
915 """
7771
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
916 with E5OverrideCursor():
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
917 packageData = self.__pip.getPackageDetails(
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
918 packageName, packageVersion)
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
919
6798
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
920 if packageData:
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
921 from .PipPackageDetailsDialog import PipPackageDetailsDialog
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
922
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
923 self.showDetailsButton.setEnabled(True)
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
924
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
925 if installable:
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
926 buttonsMode = PipPackageDetailsDialog.ButtonInstall
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
927 elif upgradable:
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
928 buttonsMode = (
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
929 PipPackageDetailsDialog.ButtonRemove |
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
930 PipPackageDetailsDialog.ButtonUpgrade
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
931 )
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
932 else:
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
933 buttonsMode = PipPackageDetailsDialog.ButtonRemove
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
934
6798
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
935 if self.__packageDetailsDialog is not None:
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
936 self.__packageDetailsDialog.close()
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
937
7255
d595f6f9cbf8 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7241
diff changeset
938 self.__packageDetailsDialog = (
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
939 PipPackageDetailsDialog(packageData, buttonsMode=buttonsMode,
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
940 parent=self)
7255
d595f6f9cbf8 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7241
diff changeset
941 )
6798
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
942 self.__packageDetailsDialog.show()
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
943 else:
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
944 E5MessageBox.warning(
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
945 self,
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
946 self.tr("Search PyPI"),
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
947 self.tr("""<p>No package details info for <b>{0}</b>"""
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
948 """ available.</p>""").format(packageName))
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
949
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
950 #######################################################################
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
951 ## Menu related methods below
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
952 #######################################################################
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
953
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
954 def __initPipMenu(self):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
955 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
956 Private method to create the super menu and attach it to the super
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
957 menu button.
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
958 """
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
959 self.__pipMenu = QMenu()
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
960 self.__installPipAct = self.__pipMenu.addAction(
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
961 self.tr("Install Pip"),
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
962 self.__installPip)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
963 self.__installPipUserAct = self.__pipMenu.addAction(
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
964 self.tr("Install Pip to User-Site"),
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
965 self.__installPipUser)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
966 self.__repairPipAct = self.__pipMenu.addAction(
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
967 self.tr("Repair Pip"),
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
968 self.__repairPip)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
969 self.__pipMenu.addSeparator()
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
970 self.__installPackagesAct = self.__pipMenu.addAction(
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
971 self.tr("Install Packages"),
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
972 self.__installPackages)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
973 self.__installLocalPackageAct = self.__pipMenu.addAction(
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
974 self.tr("Install Local Package"),
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
975 self.__installLocalPackage)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
976 self.__pipMenu.addSeparator()
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
977 self.__installRequirementsAct = self.__pipMenu.addAction(
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
978 self.tr("Install Requirements"),
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
979 self.__installRequirements)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
980 self.__uninstallRequirementsAct = self.__pipMenu.addAction(
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
981 self.tr("Uninstall Requirements"),
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
982 self.__uninstallRequirements)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
983 self.__generateRequirementsAct = self.__pipMenu.addAction(
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
984 self.tr("Generate Requirements..."),
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
985 self.__generateRequirements)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
986 self.__pipMenu.addSeparator()
7626
7f643d41464e pip Interface: added menu action for pip cache management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7477
diff changeset
987 self.__cacheInfoAct = self.__pipMenu.addAction(
7f643d41464e pip Interface: added menu action for pip cache management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7477
diff changeset
988 self.tr("Show Cache Info..."),
7f643d41464e pip Interface: added menu action for pip cache management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7477
diff changeset
989 self.__showCacheInfo)
7f643d41464e pip Interface: added menu action for pip cache management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7477
diff changeset
990 self.__cacheShowListAct = self.__pipMenu.addAction(
7f643d41464e pip Interface: added menu action for pip cache management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7477
diff changeset
991 self.tr("Show Cached Files..."),
7f643d41464e pip Interface: added menu action for pip cache management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7477
diff changeset
992 self.__showCacheList)
7f643d41464e pip Interface: added menu action for pip cache management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7477
diff changeset
993 self.__cacheRemoveAct = self.__pipMenu.addAction(
7f643d41464e pip Interface: added menu action for pip cache management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7477
diff changeset
994 self.tr("Remove Cached Files..."),
7f643d41464e pip Interface: added menu action for pip cache management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7477
diff changeset
995 self.__removeCachedFiles)
7f643d41464e pip Interface: added menu action for pip cache management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7477
diff changeset
996 self.__cachePurgeAct = self.__pipMenu.addAction(
7f643d41464e pip Interface: added menu action for pip cache management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7477
diff changeset
997 self.tr("Purge Cache..."),
7f643d41464e pip Interface: added menu action for pip cache management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7477
diff changeset
998 self.__purgeCache)
7f643d41464e pip Interface: added menu action for pip cache management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7477
diff changeset
999 self.__pipMenu.addSeparator()
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1000 # editUserConfigAct
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1001 self.__pipMenu.addAction(
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1002 self.tr("Edit User Configuration..."),
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1003 self.__editUserConfiguration)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1004 self.__editVirtualenvConfigAct = self.__pipMenu.addAction(
6806
d306647cb82d Updated translations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6804
diff changeset
1005 self.tr("Edit Environment Configuration..."),
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1006 self.__editVirtualenvConfiguration)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1007 self.__pipMenu.addSeparator()
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1008 # pipConfigAct
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1009 self.__pipMenu.addAction(
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1010 self.tr("Configure..."),
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1011 self.__pipConfigure)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1012
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1013 self.__pipMenu.aboutToShow.connect(self.__aboutToShowPipMenu)
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
1014
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
1015 self.pipMenuButton.setMenu(self.__pipMenu)
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1016
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1017 def __aboutToShowPipMenu(self):
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1018 """
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1019 Private slot to set the action enabled status.
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1020 """
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1021 enable = bool(self.environmentsComboBox.currentText())
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1022 enablePip = self.__isPipAvailable()
7641
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
1023 enablePipCache = self.__availablePipVersion() >= (20, 1, 0)
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1024
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1025 self.__installPipAct.setEnabled(not enablePip)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1026 self.__installPipUserAct.setEnabled(not enablePip)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1027 self.__repairPipAct.setEnabled(enablePip)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1028
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1029 self.__installPackagesAct.setEnabled(enablePip)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1030 self.__installLocalPackageAct.setEnabled(enablePip)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1031
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1032 self.__installRequirementsAct.setEnabled(enablePip)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1033 self.__uninstallRequirementsAct.setEnabled(enablePip)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1034 self.__generateRequirementsAct.setEnabled(enablePip)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1035
7641
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
1036 self.__cacheInfoAct.setEnabled(enablePipCache)
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
1037 self.__cacheShowListAct.setEnabled(enablePipCache)
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
1038 self.__cacheRemoveAct.setEnabled(enablePipCache)
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
1039 self.__cachePurgeAct.setEnabled(enablePipCache)
7626
7f643d41464e pip Interface: added menu action for pip cache management.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7477
diff changeset
1040
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1041 self.__editVirtualenvConfigAct.setEnabled(enable)
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1042
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1043 @pyqtSlot()
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1044 def __installPip(self):
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1045 """
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1046 Private slot to install pip into the selected environment.
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1047 """
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1048 venvName = self.environmentsComboBox.currentText()
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1049 if venvName:
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1050 self.__pip.installPip(venvName)
7826
704c46e040a2 PipInterface: some little enhancements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7785
diff changeset
1051 self.on_refreshButton_clicked()
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1052
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1053 @pyqtSlot()
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1054 def __installPipUser(self):
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1055 """
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1056 Private slot to install pip into the user site for the selected
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1057 environment.
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1058 """
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1059