aboutsummaryrefslogtreecommitdiffstats
path: root/community/gns3-gui/fix-qt5-sip.patch
blob: 0712fc4497f50212e1c5f63e94fa0fa0bc5bdcef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
diff --git a/gns3/console_cmd.py b/gns3/console_cmd.py
index 5e630f43..b1d0673a 100644
--- a/gns3/console_cmd.py
+++ b/gns3/console_cmd.py
@@ -22,7 +22,7 @@ Handles commands typed in the GNS3 console.
 import sys
 import cmd
 import struct
-import sip
+from .qt import sip
 import json
 
 from .node import Node
diff --git a/gns3/console_view.py b/gns3/console_view.py
index 10edb860..365f7bc1 100644
--- a/gns3/console_view.py
+++ b/gns3/console_view.py
@@ -16,7 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import sys
-import sip
+from .qt import sip
 import struct
 import inspect
 import datetime
diff --git a/gns3/crash_report.py b/gns3/crash_report.py
index bc37d061..a9379e16 100644
--- a/gns3/crash_report.py
+++ b/gns3/crash_report.py
@@ -132,7 +132,7 @@ class CrashReport:
     def _add_qt_information(self, context):
         try:
             from .qt import QtCore
-            import sip
+            from .qt import sip
         except ImportError:
             return context
         context["psutil:version"] = psutil.__version__
diff --git a/gns3/dialogs/appliance_wizard.py b/gns3/dialogs/appliance_wizard.py
index 06f2bf2a..8ab386b4 100644
--- a/gns3/dialogs/appliance_wizard.py
+++ b/gns3/dialogs/appliance_wizard.py
@@ -16,7 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import os
-import sip
+from ..qt import sip
 import shutil
 
 from ..qt import QtWidgets, QtCore, QtGui, qpartial, qslot
diff --git a/gns3/graphics_view.py b/gns3/graphics_view.py
index 517bfaaf..da058385 100644
--- a/gns3/graphics_view.py
+++ b/gns3/graphics_view.py
@@ -21,7 +21,7 @@ Graphical view on the scene where items are drawn.
 
 import logging
 import os
-import sip
+from .qt import sip
 import sys
 
 from .qt import QtCore, QtGui, QtNetwork, QtWidgets, qpartial, qslot
diff --git a/gns3/http_client.py b/gns3/http_client.py
index c0ceca69..6993bf58 100644
--- a/gns3/http_client.py
+++ b/gns3/http_client.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-import sip
+from .qt import sip
 import json
 import copy
 import http
diff --git a/gns3/items/node_item.py b/gns3/items/node_item.py
index cac82e70..b4ec7930 100644
--- a/gns3/items/node_item.py
+++ b/gns3/items/node_item.py
@@ -19,7 +19,7 @@
 Graphical representation of a node on the QGraphicsScene.
 """
 
-import sip
+from ..qt import sip
 
 from ..qt import QtCore, QtGui, QtWidgets, QtSvg, qslot
 from ..qt.qimage_svg_renderer import QImageSvgRenderer
diff --git a/gns3/link.py b/gns3/link.py
index 1cd634c0..323823b1 100644
--- a/gns3/link.py
+++ b/gns3/link.py
@@ -21,7 +21,7 @@ Manages and stores everything needed for a connection between 2 devices.
 
 import os
 import re
-import sip
+from .qt import sip
 import uuid
 
 from .qt import QtCore, QtWidgets
diff --git a/gns3/nodes_view.py b/gns3/nodes_view.py
index 463a63fe..16f51ed4 100644
--- a/gns3/nodes_view.py
+++ b/gns3/nodes_view.py
@@ -22,7 +22,7 @@ on the QGraphics scene.
 
 import tempfile
 import json
-import sip
+from .qt import sip
 
 from .qt import QtCore, QtGui, QtWidgets, qpartial
 from .modules import MODULES
diff --git a/gns3/ports/port.py b/gns3/ports/port.py
index 66776a33..3425df0a 100644
--- a/gns3/ports/port.py
+++ b/gns3/ports/port.py
@@ -19,7 +19,7 @@
 Base class for port objects.
 """
 
-import sip
+from ..qt import sip
 
 from ..qt import qslot
 
diff --git a/gns3/progress.py b/gns3/progress.py
index 4f167bbd..33135513 100644
--- a/gns3/progress.py
+++ b/gns3/progress.py
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-import sip
+from .qt import sip
 import time
 from contextlib import contextmanager
 
diff --git a/gns3/qt/__init__.py b/gns3/qt/__init__.py
index b8d9550e..ae88c4bf 100644
--- a/gns3/qt/__init__.py
+++ b/gns3/qt/__init__.py
@@ -24,7 +24,6 @@ Compatibility layer for Qt bindings, so it is easier to switch to PySide if need
 
 
 import sys
-import sip
 import os
 import re
 import inspect
@@ -33,12 +32,17 @@ import functools
 import logging
 log = logging.getLogger("qt/__init__.py")
 
+try:
+    import sip
+except ImportError:
+    from PyQt5 import sip
 from PyQt5 import QtCore, QtGui, QtNetwork, QtWidgets, Qt
 sys.modules[__name__ + '.QtCore'] = QtCore
 sys.modules[__name__ + '.QtGui'] = QtGui
 sys.modules[__name__ + '.QtNetwork'] = QtNetwork
 sys.modules[__name__ + '.QtWidgets'] = QtWidgets
 sys.modules[__name__ + '.Qt'] = Qt
+sys.modules[__name__ + '.sip'] = sip
 
 try:
     from PyQt5 import QtSvg
diff --git a/gns3/utils/progress_dialog.py b/gns3/utils/progress_dialog.py
index b6a84af9..9742e1b3 100644
--- a/gns3/utils/progress_dialog.py
+++ b/gns3/utils/progress_dialog.py
@@ -19,7 +19,7 @@
 Progress dialog that blocking tasks (file operations, network connections etc.)
 """
 
-import sip
+from ..qt import sip
 from gns3.version import __version__
 from ..qt import QtWidgets, QtCore, qslot
 
diff --git a/gns3/utils/wait_for_lambda_worker.py b/gns3/utils/wait_for_lambda_worker.py
index 78a5207a..d24a3cb0 100644
--- a/gns3/utils/wait_for_lambda_worker.py
+++ b/gns3/utils/wait_for_lambda_worker.py
@@ -19,7 +19,7 @@
 Thread showing a progress dialog and running the code from a lambda
 """
 
-import sip
+from ..qt import sip
 
 from ..qt import QtCore