eric6/E5Network/E5XmlRpcClient.py

Sat, 10 Oct 2020 12:20:51 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 10 Oct 2020 12:20:51 +0200
changeset 7771
787a6b3f8c9f
parent 7628
f904d0eef264
child 7780
41420f82c0ac
permissions
-rw-r--r--

Optimized the use of Waiting Cursors by using a specialized context manager class.

4258
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7360
9190402e4505 Updated copyright for 2020.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7253
diff changeset
3 # Copyright (c) 2015 - 2020 Detlev Offenbach <detlev@die-offenbachs.de>
4258
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a xmlrpc client for Qt.
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
10
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
11 import xmlrpc.client as xmlrpc
4258
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
7771
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7628
diff changeset
13 from PyQt5.QtCore import Qt, QObject, QUrl, QByteArray, QEventLoop
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7628
diff changeset
14 from PyQt5.QtGui import QGuiApplication, QCursor
7253
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
15 from PyQt5.QtNetwork import (
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
16 QNetworkAccessManager, QNetworkRequest, QNetworkReply
50dbe65a1334 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
17 )
4258
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 from E5Network.E5NetworkProxyFactory import proxyAuthenticationRequired
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 try:
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 from E5Network.E5SslErrorHandler import E5SslErrorHandler
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 SSL_AVAILABLE = True
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 except ImportError:
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 SSL_AVAILABLE = False
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 class E5XmlRpcClient(QObject):
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 """
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 Class implementing a xmlrpc client for Qt.
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 """
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 def __init__(self, url, parent=None):
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 """
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 Constructor
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 @param url xmlrpc handler URL (string or QUrl)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 @param parent parent object (QObject)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 """
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 super(E5XmlRpcClient, self).__init__(parent)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 # attributes for the network objects
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 self.__networkManager = QNetworkAccessManager(self)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 self.__networkManager.proxyAuthenticationRequired.connect(
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 proxyAuthenticationRequired)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 self.__networkManager.finished.connect(self.__replyFinished)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 if SSL_AVAILABLE:
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 self.__sslErrorHandler = E5SslErrorHandler(self)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 self.__networkManager.sslErrors.connect(self.__sslErrors)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 self.__callmap = {}
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 self.__request = QNetworkRequest(QUrl(url))
4326
e52318f11812 Change code to make eric compatible to PyQt 5.5 (QByteArry issue).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4258
diff changeset
52 self.__request.setRawHeader(b"User-Agent", b"E5XmlRpcClient/1.0")
4258
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 self.__request.setHeader(QNetworkRequest.ContentTypeHeader, "text/xml")
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 def setUrl(self, url):
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 """
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 Public slot to set the xmlrpc handler URL.
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 @param url xmlrpc handler URL (string or QUrl)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 """
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 url = QUrl(url)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 if url.isValid():
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 self.__request.setUrl(url)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 def call(self, method, args, responseCallback, errorCallback):
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 """
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 Public method to call the remote server.
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 @param method name of the remote method to be called (string)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 @param args tuple of method arguments (tuple)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 @param responseCallback method to be called with the returned
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 result as a tuple (function)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 @param errorCallback method to be called in case of an error
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 with error code and error string (function)
7628
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
75 @exception TypeError raised to indicate an illegal 'args' parameter
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
76 type
4258
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 """
7628
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
78 if not isinstance(args, tuple):
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
79 raise TypeError("argument 'args' must be tuple")
4258
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80
7771
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7628
diff changeset
81 QGuiApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7628
diff changeset
82 QGuiApplication.processEvents(QEventLoop.ExcludeUserInputEvents)
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7628
diff changeset
83
4258
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 data = xmlrpc.dumps(args, method).encode("utf-8")
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 reply = self.__networkManager.post(
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 self.__request, QByteArray(data))
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 self.__callmap[reply] = (responseCallback, errorCallback)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 def abort(self):
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 """
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 Public method to abort all calls.
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 """
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 for reply in list(self.__callmap):
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 if reply.isRunning():
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 reply.abort()
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 def __sslErrors(self, reply, errors):
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 """
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 Private slot to handle SSL errors.
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 @param reply reference to the reply object (QNetworkReply)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 @param errors list of SSL errors (list of QSslError)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 """
7771
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7628
diff changeset
104 QGuiApplication.restoreOverrideCursor()
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7628
diff changeset
105 QGuiApplication.processEvents(QEventLoop.ExcludeUserInputEvents)
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7628
diff changeset
106
4258
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 ignored = self.__sslErrorHandler.sslErrorsReply(reply, errors)[0]
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 if ignored == E5SslErrorHandler.NotIgnored and reply in self.__callmap:
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 self.__callmap[reply][1](xmlrpc.TRANSPORT_ERROR, self.tr(
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 "SSL Error"))
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 def __replyFinished(self, reply):
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 """
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 Private slot handling the receipt of a reply.
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 @param reply reference to the finished reply (QNetworkReply)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 """
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 if reply not in self.__callmap:
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 return
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120
7771
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7628
diff changeset
121 QGuiApplication.restoreOverrideCursor()
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7628
diff changeset
122 QGuiApplication.processEvents(QEventLoop.ExcludeUserInputEvents)
787a6b3f8c9f Optimized the use of Waiting Cursors by using a specialized context manager class.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7628
diff changeset
123
4258
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 if reply.error() != QNetworkReply.NoError:
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 self.__callmap[reply][1](xmlrpc.TRANSPORT_ERROR,
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126 reply.errorString())
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 else:
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 data = bytes(reply.readAll()).decode("utf-8")
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 try:
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 data = xmlrpc.loads(data)[0]
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131 self.__callmap[reply][0](data)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 except xmlrpc.Fault as fault:
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133 self.__callmap[reply][1](fault.faultCode, fault.faultString)
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 reply.deleteLater()
d141e2bb94cc Added a Qt based xmlrpc client.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 del self.__callmap[reply]

eric ide

mercurial