eric7/PipInterface/PipPackagesWidget.py

Thu, 02 Jun 2022 11:18:45 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 02 Jun 2022 11:18:45 +0200
branch
eric7
changeset 9114
d8abe530dae0
parent 9108
19a57544f32c
child 9117
c6afba2049cf
permissions
-rw-r--r--

Changed code of the pip widget to only show vulnerability column, if the associated checkbox is ticked.

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
8881
54e42bc2437a Updated copyright for 2022.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8604
diff changeset
3 # Copyright (c) 2019 - 2022 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
8240
93b8a353c4bf Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
13 import contextlib
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
14
8997
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
15 from packaging.specifiers import SpecifierSet
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
16
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
17 from PyQt6.QtCore import pyqtSlot, Qt, QUrl, QUrlQuery
8977
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
18 from PyQt6.QtGui import QIcon
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
19 from PyQt6.QtNetwork import QNetworkReply, QNetworkRequest
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
20 from PyQt6.QtWidgets import (
7255
d595f6f9cbf8 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7241
diff changeset
21 QWidget, QToolButton, QApplication, QHeaderView, QTreeWidgetItem,
9000
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
22 QMenu, QDialog, QAbstractItemView
7255
d595f6f9cbf8 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7241
diff changeset
23 )
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
24
8358
144a6b854f70 Sorted the eric specific extensions into packages named like the corresponding PyQt packages (i.e. EricCore,EricGui and EricWidgets).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8356
diff changeset
25 from EricWidgets.EricApplication import ericApp
144a6b854f70 Sorted the eric specific extensions into packages named like the corresponding PyQt packages (i.e. EricCore,EricGui and EricWidgets).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8356
diff changeset
26 from EricWidgets import EricMessageBox
144a6b854f70 Sorted the eric specific extensions into packages named like the corresponding PyQt packages (i.e. EricCore,EricGui and EricWidgets).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8356
diff changeset
27 from EricGui.EricOverrideCursor import EricOverrideCursor
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
28
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
29 from .PipVulnerabilityChecker import Package, VulnerabilityCheckError
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 from .Ui_PipPackagesWidget import Ui_PipPackagesWidget
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 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
33 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
34 import Preferences
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
37 class PypiSearchResultsParser(html.parser.HTMLParser):
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
38 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
39 Class implementing the parser for the PyPI search result page.
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
40 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
41 ClassPrefix = "package-snippet__"
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
42
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
43 def __init__(self, data):
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 Constructor
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
46
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
47 @param data data to be parsed
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
48 @type str
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
49 """
8218
7c09585bd960 Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8152
diff changeset
50 super().__init__()
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
51 self.__results = []
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
52 self.__activeClass = None
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
53 self.feed(data)
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 def __getClass(self, attrs):
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
56 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
57 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
58 attributes.
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 @param attrs list of tag attributes as (name, value) tuples
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
61 @type list of tuple of (str, str)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
62 @return value of the 'class' attribute or None
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
63 @rtype str
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
64 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
65 for name, value in attrs:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
66 if name == "class":
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
67 return value
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
68
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
69 return None
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 def __getDate(self, attrs):
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
72 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
73 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
74 attributes and process it.
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 @param attrs list of tag attributes as (name, value) tuples
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
77 @type list of tuple of (str, str)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
78 @return value of the 'class' attribute or None
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
79 @rtype str
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
80 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
81 for name, value in attrs:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
82 if name == "datetime":
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
83 return value.split("T")[0]
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
84
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
85 return None
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
86
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
87 def handle_starttag(self, tag, attrs):
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
88 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
89 Public method to process the start tag.
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 @param tag tag name (all lowercase)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
92 @type str
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
93 @param attrs list of tag attributes as (name, value) tuples
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
94 @type list of tuple of (str, str)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
95 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
96 if tag == "a" and self.__getClass(attrs) == "package-snippet":
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
97 self.__results.append({})
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
98
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
99 if tag in ("span", "p"):
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
100 tagClass = self.__getClass(attrs)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
101 if tagClass in (
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
102 "package-snippet__name", "package-snippet__description",
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
103 "package-snippet__version", "package-snippet__released",
9058
d1be27810566 Fixed an issue in the PyPI search function caused by a change of the PyPI web site.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9039
diff changeset
104 "package-snippet__created",
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
105 ):
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
106 self.__activeClass = tagClass
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 elif tag == "time":
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
110 attributeName = self.__activeClass.replace(self.ClassPrefix, "")
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
111 self.__results[-1][attributeName] = self.__getDate(attrs)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
112 self.__activeClass = None
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
113 else:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
114 self.__activeClass = None
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
115
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
116 def handle_data(self, data):
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
117 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
118 Public method process arbitrary data.
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
119
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
120 @param data data to be processed
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
121 @type str
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 if self.__activeClass is not None:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
124 attributeName = self.__activeClass.replace(self.ClassPrefix, "")
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
125 self.__results[-1][attributeName] = data
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
126
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
127 def handle_endtag(self, tag):
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
128 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
129 Public method to process the end tag.
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
130
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
131 @param tag tag name (all lowercase)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
132 @type str
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 self.__activeClass = None
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
135
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
136 def getResults(self):
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
137 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
138 Public method to get the extracted search results.
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
139
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
140 @return extracted result data
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
141 @rtype list of dict
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
142 """
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
143 return self.__results
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
144
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
145
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 class PipPackagesWidget(QWidget, Ui_PipPackagesWidget):
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 """
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
148 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
149 """
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
150 ShowProcessGeneralMode = 0
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
151 ShowProcessClassifiersMode = 1
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
152 ShowProcessEntryPointsMode = 2
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
153 ShowProcessFilesListMode = 3
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
154
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
155 SearchVersionRole = Qt.ItemDataRole.UserRole + 1
8977
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
156 VulnerabilityRole = Qt.ItemDataRole.UserRole + 2
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
157
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
158 PackageColumn = 0
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
159 InstalledVersionColumn = 1
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
160 AvailableVersionColumn = 2
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
161 VulnerabilityColumn = 3
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
162
8997
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
163 DepPackageColumn = 0
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
164 DepInstalledVersionColumn = 1
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
165 DepRequiredVersionColumn = 2
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
166
6828
bb6667ea9ae7 Changed the Google Mail interface to not use obsoleted packages anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6806
diff changeset
167 def __init__(self, pip, parent=None):
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 """
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169 Constructor
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170
6828
bb6667ea9ae7 Changed the Google Mail interface to not use obsoleted packages anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6806
diff changeset
171 @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
172 @type Pip
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 @param parent reference to the parent widget
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 @type QWidget
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 """
8218
7c09585bd960 Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8152
diff changeset
176 super().__init__(parent)
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 self.setupUi(self)
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178
8604
d25390ea2f19 Changed the margins of some right side bar managed items to (0, 3, 0, 0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8466
diff changeset
179 self.layout().setContentsMargins(0, 3, 0, 0)
d25390ea2f19 Changed the margins of some right side bar managed items to (0, 3, 0, 0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8466
diff changeset
180
8997
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
181 self.viewToggleButton.setIcon(UI.PixmapCache.getIcon("viewListTree"))
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
182
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 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
184 "pip_supermenu_button")
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185 self.pipMenuButton.setIcon(UI.PixmapCache.getIcon("superMenu"))
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 self.pipMenuButton.setToolTip(self.tr("pip Menu"))
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
187 self.pipMenuButton.setPopupMode(
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
188 QToolButton.ToolButtonPopupMode.InstantPopup)
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
189 self.pipMenuButton.setToolButtonStyle(
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
190 Qt.ToolButtonStyle.ToolButtonIconOnly)
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
191 self.pipMenuButton.setFocusPolicy(Qt.FocusPolicy.NoFocus)
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192 self.pipMenuButton.setAutoRaise(True)
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193 self.pipMenuButton.setShowMenuInside(True)
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194
8997
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
195 self.refreshButton.setIcon(
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
196 UI.PixmapCache.getIcon("reload"))
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
197 self.upgradeButton.setIcon(
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
198 UI.PixmapCache.getIcon("1uparrow"))
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
199 self.upgradeAllButton.setIcon(
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
200 UI.PixmapCache.getIcon("2uparrow"))
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
201 self.uninstallButton.setIcon(
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
202 UI.PixmapCache.getIcon("minus"))
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
203 self.showPackageDetailsButton.setIcon(
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
204 UI.PixmapCache.getIcon("info"))
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
205 self.searchToggleButton.setIcon(
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
206 UI.PixmapCache.getIcon("find"))
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
207 self.searchButton.setIcon(
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
208 UI.PixmapCache.getIcon("findNext"))
9000
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
209 self.searchMoreButton.setIcon(
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
210 UI.PixmapCache.getIcon("plus"))
8997
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
211 self.installButton.setIcon(
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
212 UI.PixmapCache.getIcon("plus"))
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
213 self.installUserSiteButton.setIcon(
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
214 UI.PixmapCache.getIcon("addUser"))
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
215 self.showDetailsButton.setIcon(
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
216 UI.PixmapCache.getIcon("info"))
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
217
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
218 self.refreshDependenciesButton.setIcon(
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
219 UI.PixmapCache.getIcon("reload"))
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
220 self.showDepPackageDetailsButton.setIcon(
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
221 UI.PixmapCache.getIcon("info"))
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222
6828
bb6667ea9ae7 Changed the Google Mail interface to not use obsoleted packages anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6806
diff changeset
223 self.__pip = pip
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
225 self.packagesList.header().setSortIndicator(
8977
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
226 PipPackagesWidget.PackageColumn, Qt.SortOrder.AscendingOrder)
8997
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
227 self.dependenciesList.header().setSortIndicator(
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
228 PipPackagesWidget.DepPackageColumn, Qt.SortOrder.AscendingOrder)
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
229
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
230 self.__infoLabels = {
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
231 "name": self.tr("Name:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
232 "version": self.tr("Version:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
233 "location": self.tr("Location:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
234 "requires": self.tr("Requires:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
235 "summary": self.tr("Summary:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
236 "home-page": self.tr("Homepage:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
237 "author": self.tr("Author:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
238 "author-email": self.tr("Author Email:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
239 "license": self.tr("License:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
240 "metadata-version": self.tr("Metadata Version:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
241 "installer": self.tr("Installer:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
242 "classifiers": self.tr("Classifiers:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
243 "entry-points": self.tr("Entry Points:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
244 "files": self.tr("Files:"),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
245 }
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
246 self.infoWidget.setHeaderLabels(["Key", "Value"])
8997
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
247 self.dependencyInfoWidget.setHeaderLabels(["Key", "Value"])
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
248
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
249 venvManager = ericApp().getObject("VirtualEnvManager")
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
250 venvManager.virtualEnvironmentAdded.connect(
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
251 self.on_refreshButton_clicked)
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
252 venvManager.virtualEnvironmentRemoved.connect(
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
253 self.on_refreshButton_clicked)
8999
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
254 self.__selectedEnvironment = None
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
255
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
256 project = ericApp().getObject("Project")
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
257 project.projectOpened.connect(
8999
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
258 self.__projectOpened)
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
259 project.projectClosed.connect(
8466
bb21fd901f49 Modified the shutdown code logic to not check PyPI for changed packages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
260 self.__projectClosed)
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
261
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
262 self.__initPipMenu()
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
263 self.__populateEnvironments()
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264 self.__updateActionButtons()
8997
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
265 self.__updateDepActionButtons()
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
267 self.statusLabel.hide()
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
268 self.searchWidget.hide()
9000
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
269 self.__lastSearchPage = 0
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
270
6798
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
271 self.__queryName = []
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
272 self.__querySummary = []
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
273
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
274 self.__replies = []
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
275
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
276 self.__packageDetailsDialog = None
8997
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
277
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
278 self.viewsStackWidget.setCurrentWidget(self.packagesPage)
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279
8999
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
280 @pyqtSlot()
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
281 def __projectOpened(self):
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
282 """
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
283 Private slot to handle the projectOpened signal.
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
284 """
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
285 projectVenv = self.__pip.getProjectEnvironmentString()
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
286 if projectVenv:
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
287 self.environmentsComboBox.insertItem(1, projectVenv)
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
288
8466
bb21fd901f49 Modified the shutdown code logic to not check PyPI for changed packages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
289 @pyqtSlot(bool)
bb21fd901f49 Modified the shutdown code logic to not check PyPI for changed packages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
290 def __projectClosed(self, shutdown):
bb21fd901f49 Modified the shutdown code logic to not check PyPI for changed packages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
291 """
bb21fd901f49 Modified the shutdown code logic to not check PyPI for changed packages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
292 Private slot to handle the projectClosed signal.
bb21fd901f49 Modified the shutdown code logic to not check PyPI for changed packages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
293
bb21fd901f49 Modified the shutdown code logic to not check PyPI for changed packages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
294 @param shutdown flag indicating the IDE shutdown
bb21fd901f49 Modified the shutdown code logic to not check PyPI for changed packages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
295 @type bool
bb21fd901f49 Modified the shutdown code logic to not check PyPI for changed packages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
296 """
bb21fd901f49 Modified the shutdown code logic to not check PyPI for changed packages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
297 if not shutdown:
8999
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
298 # the project entry is always at index 1
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
299 self.environmentsComboBox.removeItem(1)
8466
bb21fd901f49 Modified the shutdown code logic to not check PyPI for changed packages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8358
diff changeset
300
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301 def __populateEnvironments(self):
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
302 """
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303 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
304 """
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
305 self.environmentsComboBox.addItem("")
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
306 projectVenv = self.__pip.getProjectEnvironmentString()
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
307 if projectVenv:
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
308 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
309 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
310 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
311 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
312 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
313 )
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
314 )
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
316 def __isPipAvailable(self):
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
317 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
318 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
319 selected environment.
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
320
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
321 @return flag indicating availability
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
322 @rtype bool
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
323 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
324 available = False
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
325
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
326 venvName = self.environmentsComboBox.currentText()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
327 if venvName:
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
328 available = (
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
329 len(self.packagesList.findItems(
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
330 "pip",
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
331 Qt.MatchFlag.MatchExactly |
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
332 Qt.MatchFlag.MatchCaseSensitive)) == 1
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
333 )
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
334
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
335 return available
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
336
7641
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
337 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
338 """
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
339 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
340
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
341 @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
342 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
343 @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
344 """
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
345 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
346 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
347 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
348 pipList = self.packagesList.findItems(
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
349 "pip",
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
350 Qt.MatchFlag.MatchExactly | Qt.MatchFlag.MatchCaseSensitive
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
351 )
7641
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
352 if len(pipList) > 0:
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
353 pipVersionTuple = Globals.versionToTuple(
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
354 pipList[0].text(PipPackagesWidget.InstalledVersionColumn))
7641
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
355
21ea4fd50b0a PipPackagesWidget: made the cache actions dependent on pip version of selected environment.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7626
diff changeset
356 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
357
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
358 def getPip(self):
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
359 """
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
360 Public method to get a reference to the pip interface object.
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
361
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
362 @return reference to the pip interface object
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
363 @rtype Pip
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
364 """
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
365 return self.__pip
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
366
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
367 #######################################################################
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
368 ## Slots handling widget signals below
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
369 #######################################################################
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
370
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
371 def __selectedUpdateableItems(self):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
372 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
373 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
374
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
375 @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
376 @rtype list of QTreeWidgetItem
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
377 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
378 return [
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
379 itm for itm in self.packagesList.selectedItems()
8977
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
380 if bool(itm.text(PipPackagesWidget.AvailableVersionColumn))
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
381 ]
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
382
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
383 def __allUpdateableItems(self):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
384 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
385 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
386
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
387 @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
388 @rtype list of QTreeWidgetItem
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
389 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
390 updateableItems = []
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
391 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
392 itm = self.packagesList.topLevelItem(index)
8977
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
393 if itm.text(PipPackagesWidget.AvailableVersionColumn):
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
394 updateableItems.append(itm)
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
395
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
396 return updateableItems
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
397
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
398 def __updateActionButtons(self):
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
399 """
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
400 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
401 """
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
402 if self.__isPipAvailable():
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
403 self.upgradeButton.setEnabled(
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
404 bool(self.__selectedUpdateableItems()))
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
405 self.uninstallButton.setEnabled(
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
406 bool(self.packagesList.selectedItems()))
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
407 self.upgradeAllButton.setEnabled(
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
408 bool(self.__allUpdateableItems()))
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
409 self.showPackageDetailsButton.setEnabled(
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
410 len(self.packagesList.selectedItems()) == 1)
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
411 else:
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
412 self.upgradeButton.setEnabled(False)
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
413 self.uninstallButton.setEnabled(False)
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
414 self.upgradeAllButton.setEnabled(False)
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
415 self.showPackageDetailsButton.setEnabled(False)
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
416
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
417 def __refreshPackagesList(self):
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
418 """
8997
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
419 Private method to refresh the packages list.
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
420 """
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
421 self.packagesList.clear()
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
422 venvName = self.environmentsComboBox.currentText()
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
423 if venvName:
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
424 interpreter = self.__pip.getVirtualenvInterpreter(venvName)
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
425 if interpreter:
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
426 self.statusLabel.show()
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
427 self.statusLabel.setText(
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
428 self.tr("Getting installed packages..."))
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
429
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
430 with EricOverrideCursor():
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
431 # 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
432 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
433 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
434 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
435 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
436 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
437 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
438 )
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
439 for package, version in installedPackages:
8977
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
440 QTreeWidgetItem(self.packagesList,
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
441 [package, version, "", ""])
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
442 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
443 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
444 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
445 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
446
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
447 # 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
448 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
449 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
450 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
451 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
452 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
453 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
454 )
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
455 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
456 items = self.packagesList.findItems(
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
457 package,
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
458 Qt.MatchFlag.MatchExactly |
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
459 Qt.MatchFlag.MatchCaseSensitive
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
460 )
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
461 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
462 itm = items[0]
8977
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
463 itm.setText(
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
464 PipPackagesWidget.AvailableVersionColumn,
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
465 latest)
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
466
8977
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
467 self.packagesList.sortItems(
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
468 PipPackagesWidget.PackageColumn,
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
469 Qt.SortOrder.AscendingOrder)
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
470 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
471 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
472 self.packagesList.setUpdatesEnabled(True)
8977
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
473
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
474 # 3. update with vulnerability information
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
475 if self.vulnerabilityCheckBox.isChecked():
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
476 self.__updateVulnerabilityData()
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
477 self.statusLabel.hide()
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
478
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
479 self.__updateActionButtons()
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
480 self.__updateSearchActionButtons()
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
481 self.__updateSearchButton()
9000
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
482 self.__updateSearchMoreButton(False)
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
483
8999
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
484 @pyqtSlot(str)
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
485 def on_environmentsComboBox_currentTextChanged(self, name):
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
486 """
7241
0c0c9015c40f PipPackagesWidget: corrected a copy & paste issue in a source docu string.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
487 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
488
8999
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
489 @param name name of the selected Python environment
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
490 @type str
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
491 """
8999
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
492 if name != self.__selectedEnvironment:
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
493 if self.viewToggleButton.isChecked():
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
494 self.__refreshDependencyTree()
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
495 else:
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
496 self.__refreshPackagesList()
723f61499a79 Pip Interface: added some performance improvements.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8997
diff changeset
497 self.__selectedEnvironment = name
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
498
8977
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
499 @pyqtSlot()
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
500 def on_localCheckBox_clicked(self):
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
501 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
502 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
503 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
504 self.__refreshPackagesList()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
505
8977
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
506 @pyqtSlot()
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
507 def on_notRequiredCheckBox_clicked(self):
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
508 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
509 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
510 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
511 self.__refreshPackagesList()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
512
8977
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
513 @pyqtSlot()
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
514 def on_userCheckBox_clicked(self):
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
515 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
516 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
517 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
518 self.__refreshPackagesList()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
519
8997
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
520 def __showPackageInformation(self, packageName, infoWidget):
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
521 """
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
522 Private method to show information for a package.
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
523
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
524 @param packageName name of the package
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
525 @type str
8997
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
526 @param infoWidget reference to the widget to contain the information
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
527 @type QTreeWidget
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
528 """
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
529 environment = self.environmentsComboBox.currentText()
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
530 interpreter = self.__pip.getVirtualenvInterpreter(environment)
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
531 if not interpreter:
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
532 return
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
533
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
534 args = ["-m", "pip", "show"]
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
535 if self.verboseCheckBox.isChecked():
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
536 args.append("--verbose")
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
537 if self.installedFilesCheckBox.isChecked():
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
538 args.append("--files")
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
539 args.append(packageName)
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
540
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
541 with EricOverrideCursor():
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
542 success, output = self.__pip.runProcess(args, interpreter)
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
543
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
544 if success and output:
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
545 mode = self.ShowProcessGeneralMode
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
546 for line in output.splitlines():
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
547 line = line.rstrip()
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
548 if line != "---":
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
549 if mode != self.ShowProcessGeneralMode:
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
550 if line[0] == " ":
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
551 QTreeWidgetItem(
8997
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
552 infoWidget,
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
553 [" ", line.strip()])
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
554 else:
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
555 mode = self.ShowProcessGeneralMode
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
556 if mode == self.ShowProcessGeneralMode:
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
557 try:
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
558 label, info = line.split(": ", 1)
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
559 except ValueError:
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
560 label = line[:-1]
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
561 info = ""
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
562 label = label.lower()
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
563 if label in self.__infoLabels:
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
564 QTreeWidgetItem(
8997
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
565 infoWidget,
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
566 [self.__infoLabels[label], info])
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
567 if label == "files":
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
568 mode = self.ShowProcessFilesListMode
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
569 elif label == "classifiers":
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
570 mode = self.ShowProcessClassifiersMode
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
571 elif label == "entry-points":
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
572 mode = self.ShowProcessEntryPointsMode
8997
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
573 infoWidget.scrollToTop()
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
574
8997
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
575 header = infoWidget.header()
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
576 header.setStretchLastSection(False)
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
577 header.resizeSections(QHeaderView.ResizeMode.ResizeToContents)
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
578 if (
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
579 header.sectionSize(0) + header.sectionSize(1) <
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
580 header.width()
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
581 ):
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
582 header.setStretchLastSection(True)
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
583
8985
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
584 @pyqtSlot()
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
585 def on_packagesList_itemSelectionChanged(self):
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
586 """
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
587 Private slot reacting on a change of selected items.
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
588 """
8985
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
589 if len(self.packagesList.selectedItems()) == 0:
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
590 self.infoWidget.clear()
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
591
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
592 @pyqtSlot(QTreeWidgetItem, int)
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
593 def on_packagesList_itemPressed(self, item, column):
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
594 """
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
595 Private slot reacting on a package item being pressed.
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
596
8985
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
597 @param item reference to the pressed item
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
598 @type QTreeWidgetItem
8985
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
599 @param column pressed column
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
600 @type int
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
601 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
602 self.infoWidget.clear()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
603
8985
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
604 if item is not None:
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
605 if (
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
606 column == PipPackagesWidget.VulnerabilityColumn and
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
607 bool(item.text(PipPackagesWidget.VulnerabilityColumn))
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
608 ):
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
609 self.__showVulnerabilityInformation(
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
610 item.text(PipPackagesWidget.PackageColumn),
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
611 item.text(PipPackagesWidget.InstalledVersionColumn),
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
612 item.data(PipPackagesWidget.VulnerabilityColumn,
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
613 PipPackagesWidget.VulnerabilityRole)
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
614 )
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
615 else:
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
616 self.__showPackageInformation(
8997
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
617 item.text(PipPackagesWidget.PackageColumn),
d8946c2a22b5 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8985
diff changeset
618 self.infoWidget
8985
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
619 )
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
620
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
621 self.__updateActionButtons()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
622
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
623 @pyqtSlot(QTreeWidgetItem, int)
8985
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
624 def on_packagesList_itemActivated(self, item, column):
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
625 """
8985
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
626 Private slot reacting on a package item being activated.
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
627
8985
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
628 @param item reference to the activated item
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
629 @type QTreeWidgetItem
8985
30e9e592732d pip Interface: Fine tuned the mouse behavior of the pip packages list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8978
diff changeset
630 @param column activated column
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
631 @type int
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
632 """
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
633 packageName = item.text(PipPackagesWidget.PackageColumn)
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
634 upgradable = bool(item.text(PipPackagesWidget.AvailableVersionColumn))
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
635 if column == PipPackagesWidget.InstalledVersionColumn:
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
636 # show details for installed version
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
637 packageVersion = item.text(
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
638 PipPackagesWidget.InstalledVersionColumn)
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
639 else:
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
640 # show details for available version or installed one
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
641 if item.text(PipPackagesWidget.AvailableVersionColumn):
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
642 packageVersion = item.text(
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
643 PipPackagesWidget.AvailableVersionColumn)
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
644 else:
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
645 packageVersion = item.text(
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
646 PipPackagesWidget.InstalledVersionColumn)
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
647
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
648 self.__showPackageDetails(packageName, packageVersion,
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
649 upgradable=upgradable)
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
650
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
651 @pyqtSlot(bool)
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
652 def on_verboseCheckBox_clicked(self, checked):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
653 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
654 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
655 checkbox.
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
656
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
657 @param checked state of the checkbox
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
658 @type bool
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
659 """
9102
78dc7b63a06d Corrected two bugs in PipPackagesWidget caused by renaming a method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9058
diff changeset
660 self.on_packagesList_itemPressed(self.packagesList.currentItem(),
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
661 self.packagesList.currentColumn())
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
662
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
663 @pyqtSlot(bool)
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
664 def on_installedFilesCheckBox_clicked(self, checked):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
665 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
666 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
667 checkbox.
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
668
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
669 @param checked state of the checkbox
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
670 @type bool
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
671 """
9102
78dc7b63a06d Corrected two bugs in PipPackagesWidget caused by renaming a method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9058
diff changeset
672 self.on_packagesList_itemPressed(self.packagesList.currentItem(),
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
673 self.packagesList.currentColumn())
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
674
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
675 @pyqtSlot()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
676 def on_refreshButton_clicked(self):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
677 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
678 Private slot to refresh the display.
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
679 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
680 currentEnvironment = self.environmentsComboBox.currentText()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
681 self.environmentsComboBox.clear()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
682 self.packagesList.clear()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
683
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
684 with EricOverrideCursor():
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
685 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
686
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7759
diff changeset
687 index = self.environmentsComboBox.findText(
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
688 currentEnvironment,
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
689 Qt.MatchFlag.MatchExactly | Qt.MatchFlag.MatchCaseSensitive
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
690 )
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
691 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
692 self.environmentsComboBox.setCurrentIndex(index)
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
693
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
694 self.__updateActionButtons()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
695
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
696 @pyqtSlot()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
697 def on_upgradeButton_clicked(self):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
698 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
699 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
700 """
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
701 packages = [itm.text(PipPackagesWidget.PackageColumn)
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
702 for itm in self.__selectedUpdateableItems()]
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
703 if packages:
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
704 self.executeUpgradePackages(packages)
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
705
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
706 @pyqtSlot()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
707 def on_upgradeAllButton_clicked(self):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
708 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
709 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
710 """
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
711 packages = [itm.text(PipPackagesWidget.PackageColumn)
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
712 for itm in self.__allUpdateableItems()]
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
713 if packages:
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
714 self.executeUpgradePackages(packages)
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
715
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
716 @pyqtSlot()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
717 def on_uninstallButton_clicked(self):
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
718 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
719 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
720 """
8977
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
721 packages = [itm.text(PipPackagesWidget.PackageColumn)
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
722 for itm in self.packagesList.selectedItems()]
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
723 self.executeUninstallPackages(packages)
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
724
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
725 def executeUninstallPackages(self, packages):
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
726 """
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
727 Public method to uninstall the given list of packages.
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
728
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
729 @param packages list of package names to be uninstalled
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
730 @type list of str
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
731 """
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
732 if packages:
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
733 ok = self.__pip.uninstallPackages(
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
734 packages,
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
735 venvName=self.environmentsComboBox.currentText())
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
736 if ok:
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
737 self.on_refreshButton_clicked()
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
738
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
739 def executeUpgradePackages(self, packages):
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
740 """
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
741 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
742
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
743 @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
744 @type list of str
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
745 """
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
746 ok = self.__pip.upgradePackages(
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
747 packages, venvName=self.environmentsComboBox.currentText(),
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
748 userSite=self.userCheckBox.isChecked())
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
749 if ok:
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
750 self.on_refreshButton_clicked()
6792
9dd854f05c83 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6785
diff changeset
751
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
752 @pyqtSlot()
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
753 def on_showPackageDetailsButton_clicked(self):
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
754 """
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
755 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
756 """
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
757 item = self.packagesList.selectedItems()[0]
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
758 if item:
8977
663521af48b2 Started implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8881
diff changeset
759 packageName = item.text(PipPackagesWidget.PackageColumn)
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
760 upgradable = bool(item.text(
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
761 PipPackagesWidget.AvailableVersionColumn))
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
762 # show details for available version or installed one
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
763 if item.text(PipPackagesWidget.AvailableVersionColumn):
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
764 packageVersion = item.text(
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
765 PipPackagesWidget.AvailableVersionColumn)
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
766 else:
8978
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
767 packageVersion = item.text(
38c3ddf21537 Continued implementing a vulnerability checker based on the data of the Safety DB.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8977
diff changeset
768 PipPackagesWidget.InstalledVersionColumn)
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
769
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
770 self.__showPackageDetails(packageName, packageVersion,
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
771 upgradable=upgradable)
6801
df623ed5aaa6 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6798
diff changeset
772
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
773 #######################################################################
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
774 ## Search widget related methods below
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
775 #######################################################################
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
776
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
777 def __updateSearchActionButtons(self):
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
778 """
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
779 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
780 """
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
781 installEnable = (
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
782 len(self.searchResultList.selectedItems()) > 0 and
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
783 self.environmentsComboBox.currentIndex() > 0 and
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
784 self.__isPipAvailable()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
785 )
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
786 self.installButton.setEnabled(installEnable)
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
787 self.installUserSiteButton.setEnabled(installEnable)
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
788
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
789 self.showDetailsButton.setEnabled(
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
790 len(self.searchResultList.selectedItems()) == 1 and
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
791 self.__isPipAvailable()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
792 )
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
794 def __updateSearchButton(self):
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
795 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
796 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
797 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
798 self.searchButton.setEnabled(
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
799 bool(self.searchEditName.text()) and
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
800 self.__isPipAvailable()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
801 )
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
802
9000
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
803 def __updateSearchMoreButton(self, enable):
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
804 """
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
805 Private method to update the state of the search more button.
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
806
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
807 @param enable flag indicating the desired enable state
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
808 @type bool
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
809 """
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
810 self.searchMoreButton.setEnabled(
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
811 enable and
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
812 bool(self.searchEditName.text()) and
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
813 self.__isPipAvailable()
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
814 )
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
815
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
816 @pyqtSlot(bool)
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
817 def on_searchToggleButton_toggled(self, checked):
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
818 """
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
819 Private slot to togle the search widget.
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
820
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
821 @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
822 @type bool
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
823 """
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
824 self.searchWidget.setVisible(checked)
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
825
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
826 if checked:
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
827 self.searchEditName.setFocus(Qt.FocusReason.OtherFocusReason)
6798
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
828 self.searchEditName.selectAll()
6785
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
829
058d63c537a4 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
830 self.__updateSearchActionButtons()
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
831 self.__updateSearchButton()
9000
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
832 self.__updateSearchMoreButton(False)
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
833
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
834 @pyqtSlot(str)
6798
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
835 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
836 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
837 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
838
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
839 @param txt search term
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
840 @type str
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
841 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
842 self.__updateSearchButton()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
843
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
844 @pyqtSlot()
6798
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
845 def on_searchEditName_returnPressed(self):
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
846 """
3985c1a67fa2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6795
diff changeset
847 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
848 """
7477
98058d3ba634 PipPackagesWidget: fixed a bug related to searching PyPI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
849 if (
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
850 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
851 self.__isPipAvailable()
98058d3ba634 PipPackagesWidget: fixed a bug related to searching PyPI.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
852 ):
9000
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
853 self.__searchFirst()
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
854
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
855 @pyqtSlot()
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
856 def on_searchButton_clicked(self):
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
857 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
858 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
859 """
9000
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
860 self.__searchFirst()
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
861
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
862 @pyqtSlot()
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
863 def on_searchMoreButton_clicked(self):
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
864 """
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
865 Private slot handling a press of the search more button.
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
866 """
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
867 self.__search(self.__lastSearchPage + 1)
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
868
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
869 @pyqtSlot()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
870 def on_searchResultList_itemSelectionChanged(self):
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
871 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
872 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
873 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
874 self.__updateSearchActionButtons()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
875
9000
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
876 def __searchFirst(self):
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
877 """
9000
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
878 Private method to perform the search for packages.
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
879 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
880 self.searchResultList.clear()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
881 self.searchInfoLabel.clear()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
882
9000
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
883 self.__updateSearchMoreButton(False)
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
884
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
885 self.__search()
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
886
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
887 def __search(self, page=1):
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
888 """
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
889 Private method to perform the search by calling the PyPI search URL.
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
890
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
891 @param page search page to retrieve (defaults to 1)
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
892 @type int (optional)
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
893 """
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
894 self.__lastSearchPage = page
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
895
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
896 self.searchButton.setEnabled(False)
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
897
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
898 searchTerm = self.searchEditName.text().strip()
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
899 searchTerm = bytes(QUrl.toPercentEncoding(searchTerm)).decode()
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
900 urlQuery = QUrlQuery()
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
901 urlQuery.addQueryItem("q", searchTerm)
9000
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
902 urlQuery.addQueryItem("page", str(page))
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
903 url = QUrl(self.__pip.getIndexUrlSearch())
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
904 url.setQuery(urlQuery)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
905
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
906 request = QNetworkRequest(QUrl(url))
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
907 request.setAttribute(
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
908 QNetworkRequest.Attribute.CacheLoadControlAttribute,
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
909 QNetworkRequest.CacheLoadControl.AlwaysNetwork)
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
910 reply = self.__pip.getNetworkAccessManager().get(request)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
911 reply.finished.connect(
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
912 lambda: self.__searchResponse(reply))
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
913 self.__replies.append(reply)
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
914
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
915 def __searchResponse(self, reply):
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
916 """
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
917 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
918
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
919 @param reply reference to the reply object containing the data
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
920 @type QNetworkReply
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
921 """
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
922 if reply in self.__replies:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
923 self.__replies.remove(reply)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
924
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
925 urlQuery = QUrlQuery(reply.url())
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
926 searchTerm = urlQuery.queryItemValue("q")
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
927
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
928 if reply.error() != QNetworkReply.NetworkError.NoError:
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
929 EricMessageBox.warning(
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
930 None,
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
931 self.tr("Search PyPI"),
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
932 self.tr(
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
933 "<p>Received an error while searching for <b>{0}</b>.</p>"
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
934 "<p>Error: {1}</p>"
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
935 ).format(searchTerm, reply.errorString())
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
936 )
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
937 reply.deleteLater()
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
938 return
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
939
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
940 data = bytes(reply.readAll()).decode()
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
941 reply.deleteLater()
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
942
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
943 results = PypiSearchResultsParser(data).getResults()
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
944 if results:
9000
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
945 # PyPI returns max. 20 entries per page
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
946 if len(results) < 20:
9000
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
947 msg = self.tr("%n package(s) found.", "",
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
948 (self.__lastSearchPage - 1) * 20 + len(results))
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
949 self.__updateSearchMoreButton(False)
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
950 else:
9000
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
951 msg = self.tr("Showing first {0} packages found.").format(
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
952 self.__lastSearchPage * 20)
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
953 self.__updateSearchMoreButton(True)
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
954 self.searchInfoLabel.setText(msg)
9000
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
955 lastItem = self.searchResultList.topLevelItem(
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
956 self.searchResultList.topLevelItemCount() - 1)
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
957 else:
9000
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
958 self.__updateSearchMoreButton(False)
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
959 if self.__lastSearchPage == 1:
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
960 EricMessageBox.warning(
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
961 self,
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
962 self.tr("Search PyPI"),
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
963 self.tr("""<p>There were no results for <b>{0}</b>.</p>""")
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
964 .format(searchTerm)
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
965 )
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
966 self.searchInfoLabel.setText(
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
967 self.tr("""<p>There were no results for <b>{0}</b>.</p>""")
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
968 .format(searchTerm)
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
969 )
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
970 else:
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
971 EricMessageBox.warning(
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
972 self,
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
973 self.tr("Search PyPI"),
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
974 self.tr("""<p>There were no more results for"""
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
975 """ <b>{0}</b>.</p>""").format(searchTerm)
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
976 )
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
977 lastItem = None
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
978
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
979 wrapper = textwrap.TextWrapper(width=80)
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
980 for result in results:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
981 try:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
982 description = "\n".join([
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
983 wrapper.fill(line) for line in
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
984 result['description'].strip().splitlines()
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
985 ])
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
986 except KeyError:
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
987 description = ""
9108
19a57544f32c Corrected some code style issues and a glitch in the package license dialog filter function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9102
diff changeset
988 date = (
19a57544f32c Corrected some code style issues and a glitch in the package license dialog filter function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9102
diff changeset
989 result["released"]
19a57544f32c Corrected some code style issues and a glitch in the package license dialog filter function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9102
diff changeset
990 if "released" in result else
19a57544f32c Corrected some code style issues and a glitch in the package license dialog filter function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9102
diff changeset
991 result["created"]
19a57544f32c Corrected some code style issues and a glitch in the package license dialog filter function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9102
diff changeset
992 )
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
993 itm = QTreeWidgetItem(
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
994 self.searchResultList, [
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
995 result['name'].strip(),
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
996 result['version'],
9058
d1be27810566 Fixed an issue in the PyPI search function caused by a change of the PyPI web site.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9039
diff changeset
997 date.strip(),
8085
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
998 description,
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
999 ])
f6db8b3ecea9 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8056
diff changeset
1000 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
1001
9000
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
1002 if lastItem:
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
1003 self.searchResultList.scrollToItem(
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
1004 lastItem,
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
1005 QAbstractItemView.ScrollHint.PositionAtTop)
bc0b38405b6a pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8999
diff changeset
1006
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
1007 header = self.searchResultList.header()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
1008 header.setStretchLastSection(False)
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
1009 header.resizeSections(QHeaderView.ResizeMode.ResizeToContents)
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
1010 headerSize = 0
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
1011 for col in range(header.count()):
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
1012 headerSize += header.sectionSize(col)
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
1013 if headerSize < header.width():
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
1014 header.setStretchLastSection(True)
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
1015
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
1016 self.__finishSearch()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
1017
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
1018 def __finishSearch(self):
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
1019 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
1020 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
1021 """
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
1022 self.__updateSearchActionButtons()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
1023 self.__updateSearchButton()
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
1024
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8090
diff changeset
1025 self.searchEditName.setFocus(Qt.FocusReason.OtherFocusReason)
6793
cca6a35f3ad2 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6792
diff changeset
1026
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1027 @pyqtSlot()
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1028 def on_installButton_clicked(self):
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1029 """
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1030 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
1031 """
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
1032 packages = [
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
1033 itm.text(0).strip()
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
1034 for itm in self.searchResultList.selectedItems()
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
1035 ]
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
1036 self.executeInstallPackages(packages)
6795
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1037
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1038 @pyqtSlot()
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1039 def on_installUserSiteButton_clicked(self):
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1040 """
6e2ed2aac325 PipInterface: continued with the pip interface widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6793
diff changeset
1041 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
1042 """
8090
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
1043 packages = [
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
1044 itm.text(0).strip()
c53117374255 pip Interface
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8085
diff changeset
1045 for itm in self