4 # |
4 # |
5 |
5 |
6 """ |
6 """ |
7 Module implementing a dialog to show and edit all certificates. |
7 Module implementing a dialog to show and edit all certificates. |
8 """ |
8 """ |
|
9 |
|
10 import contextlib |
9 |
11 |
10 from PyQt5.QtCore import ( |
12 from PyQt5.QtCore import ( |
11 pyqtSlot, Qt, QByteArray, QFile, QFileInfo, QIODevice |
13 pyqtSlot, Qt, QByteArray, QFile, QFileInfo, QIODevice |
12 ) |
14 ) |
13 from PyQt5.QtWidgets import QDialog, QTreeWidgetItem |
15 from PyQt5.QtWidgets import QDialog, QTreeWidgetItem |
14 try: |
16 with contextlib.suppress(ImportError): |
15 from PyQt5.QtNetwork import ( |
17 from PyQt5.QtNetwork import ( |
16 QSslCertificate, QSslSocket, QSslConfiguration, QSsl |
18 QSslCertificate, QSslSocket, QSslConfiguration, QSsl |
17 ) |
19 ) |
18 except ImportError: |
|
19 pass |
|
20 |
20 |
21 from E5Gui import E5MessageBox, E5FileDialog |
21 from E5Gui import E5MessageBox, E5FileDialog |
22 |
22 |
23 from .Ui_E5SslCertificatesDialog import Ui_E5SslCertificatesDialog |
23 from .Ui_E5SslCertificatesDialog import Ui_E5SslCertificatesDialog |
24 |
24 |