69 self.maintainerEmailEdit]: |
69 self.maintainerEmailEdit]: |
70 lineEdit.setStyleSheet(self.__mandatoryStyleSheet) |
70 lineEdit.setStyleSheet(self.__mandatoryStyleSheet) |
71 |
71 |
72 self.__loadClassifiersFromPyPI() |
72 self.__loadClassifiersFromPyPI() |
73 |
73 |
74 self.__okButton = self.buttonBox.button(QDialogButtonBox.Ok) |
74 self.__okButton = self.buttonBox.button( |
|
75 QDialogButtonBox.StandardButton.Ok) |
75 self.__okButton.setEnabled(False) |
76 self.__okButton.setEnabled(False) |
76 |
77 |
77 projectOpen = e5App().getObject("Project").isOpen() |
78 projectOpen = e5App().getObject("Project").isOpen() |
78 self.projectButton.setEnabled(projectOpen) |
79 self.projectButton.setEnabled(projectOpen) |
79 self.autodiscoverPackagesButton.setEnabled(projectOpen) |
80 self.autodiscoverPackagesButton.setEnabled(projectOpen) |
107 """ |
108 """ |
108 Private method to populate the classifiers list with data retrieved |
109 Private method to populate the classifiers list with data retrieved |
109 from PyPI. |
110 from PyPI. |
110 """ |
111 """ |
111 request = QNetworkRequest(QUrl(SetupWizardDialog.ClassifiersUrl)) |
112 request = QNetworkRequest(QUrl(SetupWizardDialog.ClassifiersUrl)) |
112 request.setAttribute(QNetworkRequest.CacheLoadControlAttribute, |
113 request.setAttribute( |
113 QNetworkRequest.AlwaysNetwork) |
114 QNetworkRequest.Attribute.CacheLoadControlAttribute, |
|
115 QNetworkRequest.CacheLoadControl.AlwaysNetwork) |
114 reply = e5App().getObject("UserInterface").networkAccessManager().get( |
116 reply = e5App().getObject("UserInterface").networkAccessManager().get( |
115 request) |
117 request) |
116 reply.finished.connect(lambda: self.__classifiersDownloadDone(reply)) |
118 reply.finished.connect(lambda: self.__classifiersDownloadDone(reply)) |
117 self.__replies.append(reply) |
119 self.__replies.append(reply) |
118 |
120 |
126 @type QNetworkReply |
128 @type QNetworkReply |
127 """ |
129 """ |
128 reply.deleteLater() |
130 reply.deleteLater() |
129 if reply in self.__replies: |
131 if reply in self.__replies: |
130 self.__replies.remove(reply) |
132 self.__replies.remove(reply) |
131 if reply.error() == QNetworkReply.NoError: |
133 if reply.error() == QNetworkReply.NetworkError.NoError: |
132 ioEncoding = Preferences.getSystem("IOEncoding") |
134 ioEncoding = Preferences.getSystem("IOEncoding") |
133 lines = str(reply.readAll(), ioEncoding, 'replace').splitlines() |
135 lines = str(reply.readAll(), ioEncoding, 'replace').splitlines() |
134 |
136 |
135 self.__populateClassifiers(lines) |
137 self.__populateClassifiers(lines) |
136 |
138 |
189 self.__addClassifierEntry(line) |
191 self.__addClassifierEntry(line) |
190 self.__classifiersDict = {} |
192 self.__classifiersDict = {} |
191 |
193 |
192 self.licenseClassifierComboBox.setCurrentIndex( |
194 self.licenseClassifierComboBox.setCurrentIndex( |
193 self.licenseClassifierComboBox.findText( |
195 self.licenseClassifierComboBox.findText( |
194 "(GPLv3)", Qt.MatchContains | Qt.MatchCaseSensitive)) |
196 "(GPLv3)", |
|
197 Qt.MatchFlag.MatchContains | Qt.MatchFlag.MatchCaseSensitive |
|
198 ) |
|
199 ) |
195 |
200 |
196 def __addClassifierEntry(self, line): |
201 def __addClassifierEntry(self, line): |
197 """ |
202 """ |
198 Private method to add a new entry to the list of trove classifiers. |
203 Private method to add a new entry to the list of trove classifiers. |
199 |
204 |
213 itm = QTreeWidgetItem(pitm, [dataList[index]]) |
218 itm = QTreeWidgetItem(pitm, [dataList[index]]) |
214 itm.setExpanded(True) |
219 itm.setExpanded(True) |
215 self.__classifiersDict[key] = itm |
220 self.__classifiersDict[key] = itm |
216 else: |
221 else: |
217 pitm = self.__classifiersDict[key] |
222 pitm = self.__classifiersDict[key] |
218 itm.setCheckState(0, Qt.Unchecked) |
223 itm.setCheckState(0, Qt.CheckState.Unchecked) |
219 itm.setData(0, Qt.UserRole, line) |
224 itm.setData(0, Qt.ItemDataRole.UserRole, line) |
220 |
225 |
221 def __getLicenseText(self): |
226 def __getLicenseText(self): |
222 """ |
227 """ |
223 Private method to get the license text. |
228 Private method to get the license text. |
224 |
229 |
366 self.developmentStatusComboBox.currentIndex())) |
371 self.developmentStatusComboBox.currentIndex())) |
367 |
372 |
368 itm = self.classifiersList.topLevelItem(0) |
373 itm = self.classifiersList.topLevelItem(0) |
369 while itm: |
374 while itm: |
370 itm.setExpanded(True) |
375 itm.setExpanded(True) |
371 if itm.checkState(0) == Qt.Checked: |
376 if itm.checkState(0) == Qt.CheckState.Checked: |
372 classifiers.append(itm.data(0, Qt.UserRole)) |
377 classifiers.append(itm.data(0, Qt.ItemDataRole.UserRole)) |
373 itm = self.classifiersList.itemBelow(itm) |
378 itm = self.classifiersList.itemBelow(itm) |
374 |
379 |
375 # cleanup classifiers list - remove all invalid entries |
380 # cleanup classifiers list - remove all invalid entries |
376 classifiers = [c for c in classifiers if bool(c)] |
381 classifiers = [c for c in classifiers if bool(c)] |
377 if classifiers: |
382 if classifiers: |
757 """ |
762 """ |
758 pattern = ( |
763 pattern = ( |
759 self.excludePatternEdit.text().replace("\\", ".").replace("/", ".") |
764 self.excludePatternEdit.text().replace("\\", ".").replace("/", ".") |
760 ) |
765 ) |
761 if not self.excludePatternList.findItems( |
766 if not self.excludePatternList.findItems( |
762 pattern, Qt.MatchExactly | Qt.MatchCaseSensitive): |
767 pattern, |
|
768 Qt.MatchFlag.MatchExactly | Qt.MatchFlag.MatchCaseSensitive |
|
769 ): |
763 QListWidgetItem(pattern, self.excludePatternList) |
770 QListWidgetItem(pattern, self.excludePatternList) |
764 |
771 |
765 @pyqtSlot(str) |
772 @pyqtSlot(str) |
766 def on_excludePatternEdit_textChanged(self, txt): |
773 def on_excludePatternEdit_textChanged(self, txt): |
767 """ |
774 """ |