Téléverser les fichiers vers "gn_tools/processing"

This commit is contained in:
2026-03-20 14:28:15 +01:00
parent db04635b84
commit e5b3e2fedd
4 changed files with 39 additions and 39 deletions
+8 -8
View File
@@ -8,8 +8,8 @@ from qgis.PyQt.QtCore import QByteArray, QJsonDocument, QObject, QUrl, pyqtSigna
from qgis.PyQt.QtNetwork import QNetworkReply, QNetworkRequest
from qgis.PyQt.QtWidgets import QAction, QMessageBox, QDialog
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication
from qgis.PyQt.QtCore import Qt
from qgis.PyQt.QtWidgets import QApplication
# from PyQt6.QtCore import Qt
# from PyQt6.QtWidgets import QApplication
@@ -42,7 +42,7 @@ class GetLogin(QDialog):
# self.total_zh = 0
# PyQt5 - Version
QApplication.setOverrideCursor(Qt.WaitCursor)
QApplication.setOverrideCursor(Qt.CursorShape(3))
# PyQt6 - Version
# QApplication.setOverrideCursor(Qt.CursorShape.WaitCursor)
self._pending_downloads = 0
@@ -57,14 +57,14 @@ class GetLogin(QDialog):
QApplication.restoreOverrideCursor()
# If reply is an error or reply is a redirection, login is not accepted
print(reply.attribute(
QNetworkRequest.HttpStatusCodeAttribute
QNetworkRequest.Attribute(0)
))
print('Login : ',reply.error())
self.network_manager.cookieStatus = reply.attribute(
QNetworkRequest.HttpStatusCodeAttribute
QNetworkRequest.Attribute(0)
)
if (
reply.error() != QNetworkReply.NoError
reply.error() != QNetworkReply.NetworkError(0)
or self.network_manager.cookieStatus != 200
):
# Error code 299 means the logins are invalid
@@ -98,7 +98,7 @@ class GetLogin(QDialog):
else:
self.cookies = self.network_manager.cookieJar()
self.is_connect.setText("Good Job !")
QApplication.setOverrideCursor(Qt.CursorShape(0))
# If the authenfication configuration already exists,
# modify it with the new values
# self.manager_config.setConfigMap(
@@ -156,7 +156,7 @@ class GetLogin(QDialog):
}
print(url)
request = QNetworkRequest(url)
request.setHeader(QNetworkRequest.ContentTypeHeader, "application/json")
request.setHeader(QNetworkRequest.KnownHeaders(0), "application/json")
document = QJsonDocument(data_json)
print(document.toJson())
reply = self.network_manager.post(request, document.toJson())