8 """ |
8 """ |
9 |
9 |
10 from PyQt4.QtCore import * |
10 from PyQt4.QtCore import * |
11 from PyQt4.QtNetwork import QNetworkReply |
11 from PyQt4.QtNetwork import QNetworkReply |
12 |
12 |
|
13 |
13 class NetworkProtocolUnknownErrorReply(QNetworkReply): |
14 class NetworkProtocolUnknownErrorReply(QNetworkReply): |
14 """ |
15 """ |
15 Class implementing a QNetworkReply subclass reporting an unknown protocol error. |
16 Class implementing a QNetworkReply subclass reporting an unknown protocol error. |
16 """ |
17 """ |
17 def __init__(self, protocol, parent = None): |
18 def __init__(self, protocol, parent=None): |
18 """ |
19 """ |
19 Constructor |
20 Constructor |
20 |
21 |
21 @param protocol protocol name (string) |
22 @param protocol protocol name (string) |
22 @param parent reference to the parent object (QObject) |
23 @param parent reference to the parent object (QObject) |
23 """ |
24 """ |
24 QNetworkReply.__init__(self, parent) |
25 QNetworkReply.__init__(self, parent) |
25 self.setError(QNetworkReply.ProtocolUnknownError, |
26 self.setError(QNetworkReply.ProtocolUnknownError, |
26 self.trUtf8("Protocol '{0}' not supported.").format(protocol)) |
27 self.trUtf8("Protocol '{0}' not supported.").format(protocol)) |
27 QTimer.singleShot(0, self.__fireSignals) |
28 QTimer.singleShot(0, self.__fireSignals) |
28 |
29 |
29 def __fireSignals(self): |
30 def __fireSignals(self): |
30 """ |
31 """ |