6 """ |
6 """ |
7 Module implementing a dialog to show details about a package. |
7 Module implementing a dialog to show details about a package. |
8 """ |
8 """ |
9 |
9 |
10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 try: |
|
12 basestring # __IGNORE_WARNING__ |
|
13 except NameError: |
|
14 basestring = str |
|
15 |
11 |
16 from PyQt5.QtCore import Qt, QLocale |
12 from PyQt5.QtCore import Qt, QLocale |
17 from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QTreeWidgetItem, \ |
13 from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QTreeWidgetItem, \ |
18 QLabel, QHeaderView |
14 QLabel, QHeaderView |
19 |
15 |
179 elif text == "any": |
175 elif text == "any": |
180 text = self.tr("any") |
176 text = self.tr("any") |
181 elif text is None: |
177 elif text is None: |
182 text = "" |
178 text = "" |
183 if forUrl: |
179 if forUrl: |
184 if not isinstance(text, basestring) or \ |
180 if not isinstance(text, str) or \ |
185 not text.startswith(("http://", "https://", "ftp://")): |
181 not text.startswith(("http://", "https://", "ftp://")): |
186 # ignore if the schema is not one of the listed ones |
182 # ignore if the schema is not one of the listed ones |
187 text = "" |
183 text = "" |
188 |
184 |
189 return text |
185 return text |