1
0
Fork 0
mirror of synced 2024-06-17 01:54:46 +12:00

QtRequestsManager: Use doc_type instead of type

This commit is contained in:
loathingKernel 2023-03-30 20:08:44 +03:00
parent a6071b7377
commit 59826dcd76
No known key found for this signature in database
GPG key ID: CE0C72D0B53821FD

View file

@ -15,10 +15,10 @@ class QtRequestManager(QObject):
request = None
request_active = None
def __init__(self, type: str = "json", authorization_token: str = None):
def __init__(self, doc_type: str = "json", authorization_token: str = None):
super(QtRequestManager, self).__init__()
self.manager = QNetworkAccessManager()
self.type = type
self.doc_type = doc_type
self.authorization_token = authorization_token
self.request_queue = []
@ -67,11 +67,11 @@ class QtRequestManager(QObject):
def prepare_data(self):
# self.request_active = False
data = {} if self.type == "json" else b""
data = {} if self.doc_type == "json" else b""
if self.request:
try:
if self.request.error() == QNetworkReply.NoError:
if self.type == "json":
if self.doc_type == "json":
error = QJsonParseError()
json_data = QJsonDocument.fromJson(
self.request.readAll().data(), error