12 import zipfile |
12 import zipfile |
13 import types |
13 import types |
14 import importlib |
14 import importlib |
15 import contextlib |
15 import contextlib |
16 |
16 |
17 from PyQt5.QtCore import ( |
17 from PyQt6.QtCore import ( |
18 pyqtSignal, QObject, QDate, QFile, QFileInfo, QUrl, QIODevice |
18 pyqtSignal, QObject, QDate, QFile, QFileInfo, QUrl, QIODevice |
19 ) |
19 ) |
20 from PyQt5.QtGui import QPixmap |
20 from PyQt6.QtGui import QPixmap |
21 from PyQt5.QtNetwork import ( |
21 from PyQt6.QtNetwork import ( |
22 QNetworkAccessManager, QNetworkRequest, QNetworkReply |
22 QNetworkAccessManager, QNetworkRequest, QNetworkReply |
23 ) |
23 ) |
24 |
24 |
25 from E5Gui import E5MessageBox |
25 from E5Gui import E5MessageBox |
26 from E5Gui.E5Application import e5App |
26 from E5Gui.E5Application import e5App |
1255 return |
1255 return |
1256 |
1256 |
1257 self.__updateAvailable = False |
1257 self.__updateAvailable = False |
1258 |
1258 |
1259 request = QNetworkRequest( |
1259 request = QNetworkRequest( |
1260 QUrl(Preferences.getUI("PluginRepositoryUrl6"))) |
1260 QUrl(Preferences.getUI("PluginRepositoryUrl7"))) |
1261 request.setAttribute( |
1261 request.setAttribute( |
1262 QNetworkRequest.Attribute.CacheLoadControlAttribute, |
1262 QNetworkRequest.Attribute.CacheLoadControlAttribute, |
1263 QNetworkRequest.CacheLoadControl.AlwaysNetwork) |
1263 QNetworkRequest.CacheLoadControl.AlwaysNetwork) |
1264 reply = self.__networkManager.get(request) |
1264 reply = self.__networkManager.get(request) |
1265 reply.finished.connect( |
1265 reply.finished.connect( |
1281 None, |
1281 None, |
1282 self.tr("Error downloading file"), |
1282 self.tr("Error downloading file"), |
1283 self.tr( |
1283 self.tr( |
1284 """<p>Could not download the requested file""" |
1284 """<p>Could not download the requested file""" |
1285 """ from {0}.</p><p>Error: {1}</p>""" |
1285 """ from {0}.</p><p>Error: {1}</p>""" |
1286 ).format(Preferences.getUI("PluginRepositoryUrl6"), |
1286 ).format(Preferences.getUI("PluginRepositoryUrl7"), |
1287 reply.errorString()) |
1287 reply.errorString()) |
1288 ) |
1288 ) |
1289 reply.deleteLater() |
1289 reply.deleteLater() |
1290 return |
1290 return |
1291 |
1291 |
1300 |
1300 |
1301 if os.path.exists(self.pluginRepositoryFile): |
1301 if os.path.exists(self.pluginRepositoryFile): |
1302 f = QFile(self.pluginRepositoryFile) |
1302 f = QFile(self.pluginRepositoryFile) |
1303 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
1303 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
1304 # save current URL |
1304 # save current URL |
1305 url = Preferences.getUI("PluginRepositoryUrl6") |
1305 url = Preferences.getUI("PluginRepositoryUrl7") |
1306 |
1306 |
1307 # read the repository file |
1307 # read the repository file |
1308 from E5XML.PluginRepositoryReader import PluginRepositoryReader |
1308 from E5XML.PluginRepositoryReader import PluginRepositoryReader |
1309 reader = PluginRepositoryReader(f, self.checkPluginEntry) |
1309 reader = PluginRepositoryReader(f, self.checkPluginEntry) |
1310 reader.readXML() |
1310 reader.readXML() |
1311 if url != Preferences.getUI("PluginRepositoryUrl6"): |
1311 if url != Preferences.getUI("PluginRepositoryUrl7"): |
1312 # redo if it is a redirect |
1312 # redo if it is a redirect |
1313 self.checkPluginUpdatesAvailable() |
1313 self.checkPluginUpdatesAvailable() |
1314 return |
1314 return |
1315 |
1315 |
1316 if self.__updateAvailable: |
1316 if self.__updateAvailable: |