10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 |
11 |
12 import os |
12 import os |
13 |
13 |
14 from PyQt5.QtCore import pyqtSignal, QObject, QByteArray, QUrl, \ |
14 from PyQt5.QtCore import pyqtSignal, QObject, QByteArray, QUrl, \ |
15 QCoreApplication, QXmlStreamReader, qVersion |
15 QCoreApplication, QXmlStreamReader |
16 from PyQt5.QtWidgets import QApplication |
16 from PyQt5.QtWidgets import QApplication |
17 from PyQt5.QtNetwork import QNetworkRequest |
17 from PyQt5.QtNetwork import QNetworkRequest |
18 from PyQt5.QtWebKit import QWebSettings |
18 from PyQt5.QtWebKit import QWebSettings |
19 from PyQt5.QtWebKitWidgets import QWebPage |
19 from PyQt5.QtWebKitWidgets import QWebPage |
20 |
20 |
435 |
436 |
436 @param url URL to be stripped (QUrl) |
437 @param url URL to be stripped (QUrl) |
437 @return stripped URL (QUrl) |
438 @return stripped URL (QUrl) |
438 """ |
439 """ |
439 cleanUrl = QUrl(url) |
440 cleanUrl = QUrl(url) |
440 if qVersion() >= "5.0.0": |
441 if qVersionTuple() >= (5, 0, 0): |
441 cleanUrl.setQuery("") |
442 cleanUrl.setQuery("") |
442 else: |
443 else: |
443 cleanUrl.setQueryItems([]) |
444 cleanUrl.setQueryItems([]) |
444 cleanUrl.setUserInfo("") |
445 cleanUrl.setUserInfo("") |
445 |
446 |
464 from .LoginForm import LoginForm |
465 from .LoginForm import LoginForm |
465 form = LoginForm() |
466 form = LoginForm() |
466 if boundary is not None: |
467 if boundary is not None: |
467 args = self.__extractMultipartQueryItems(data, boundary) |
468 args = self.__extractMultipartQueryItems(data, boundary) |
468 else: |
469 else: |
469 if qVersion() >= "5.0.0": |
470 if qVersionTuple() >= (5, 0, 0): |
470 from PyQt5.QtCore import QUrlQuery |
471 from PyQt5.QtCore import QUrlQuery |
471 argsUrl = QUrl.fromEncoded( |
472 argsUrl = QUrl.fromEncoded( |
472 QByteArray(b"foo://bar.com/?" + QUrl.fromPercentEncoding( |
473 QByteArray(b"foo://bar.com/?" + QUrl.fromPercentEncoding( |
473 data.replace(b"+", b"%20")).encode("utf-8"))) |
474 data.replace(b"+", b"%20")).encode("utf-8"))) |
474 encodedArgs = QUrlQuery(argsUrl).queryItems() |
475 encodedArgs = QUrlQuery(argsUrl).queryItems() |