本文整理汇总了Python中PyQt5.QtCore.QUrlQuery.setQueryItems方法的典型用法代码示例。如果您正苦于以下问题:Python QUrlQuery.setQueryItems方法的具体用法?Python QUrlQuery.setQueryItems怎么用?Python QUrlQuery.setQueryItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.QUrlQuery
的用法示例。
在下文中一共展示了QUrlQuery.setQueryItems方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: url
# 需要导入模块: from PyQt5.QtCore import QUrlQuery [as 别名]
# 或者: from PyQt5.QtCore.QUrlQuery import setQueryItems [as 别名]
def url(self):
"""
Public method to generate the URL for this subscription.
@return AdBlock URL for the subscription (QUrl)
"""
url = QUrl()
url.setScheme("abp")
url.setPath("subscribe")
queryItems = []
queryItems.append(("location", bytes(self.__location).decode()))
queryItems.append(("title", self.__title))
if self.__requiresLocation and self.__requiresTitle:
queryItems.append(("requiresLocation", self.__requiresLocation))
queryItems.append(("requiresTitle", self.__requiresTitle))
if not self.__enabled:
queryItems.append(("enabled", "false"))
if self.__lastUpdate.isValid():
queryItems.append(("lastUpdate",
self.__lastUpdate.toString(Qt.ISODate)))
if qVersion() >= "5.0.0":
from PyQt5.QtCore import QUrlQuery
query = QUrlQuery()
query.setQueryItems(queryItems)
url.setQuery(query)
else:
url.setQueryItems(queryItems)
return url
示例2: getDomainReport
# 需要导入模块: from PyQt5.QtCore import QUrlQuery [as 别名]
# 或者: from PyQt5.QtCore.QUrlQuery import setQueryItems [as 别名]
def getDomainReport(self, domain):
"""
Public method to retrieve a report for a domain.
@param domain domain name
@type str
"""
self.__lastDomain = domain
queryItems = [
("apikey", Preferences.getHelp("VirusTotalServiceKey")),
("domain", domain),
]
url = QUrl(self.GetDomainReportUrl)
if qVersion() >= "5.0.0":
from PyQt5.QtCore import QUrlQuery
query = QUrlQuery()
query.setQueryItems(queryItems)
url.setQuery(query)
else:
url.setQueryItems(queryItems)
request = QNetworkRequest(url)
import Helpviewer.HelpWindow
nam = Helpviewer.HelpWindow.HelpWindow.networkAccessManager()
reply = nam.get(request)
reply.finished.connect(self.__getDomainReportFinished)
self.__replies.append(reply)
示例3: getIpAddressReport
# 需要导入模块: from PyQt5.QtCore import QUrlQuery [as 别名]
# 或者: from PyQt5.QtCore.QUrlQuery import setQueryItems [as 别名]
def getIpAddressReport(self, ipAddress):
"""
Public method to retrieve a report for an IP address.
@param ipAddress valid IPv4 address in dotted quad notation
@type str
"""
self.__lastIP = ipAddress
queryItems = [
("apikey", Preferences.getHelp("VirusTotalServiceKey")),
("ip", ipAddress),
]
url = QUrl(self.GetIpAddressReportUrl)
if qVersion() >= "5.0.0":
from PyQt5.QtCore import QUrlQuery
query = QUrlQuery()
query.setQueryItems(queryItems)
url.setQuery(query)
else:
url.setQueryItems(queryItems)
request = QNetworkRequest(url)
import Helpviewer.HelpWindow
nam = Helpviewer.HelpWindow.HelpWindow.networkAccessManager()
reply = nam.get(request)
reply.finished.connect(self.__getIpAddressReportFinished)
self.__replies.append(reply)
示例4: _preprocess_request_bind
# 需要导入模块: from PyQt5.QtCore import QUrlQuery [as 别名]
# 或者: from PyQt5.QtCore.QUrlQuery import setQueryItems [as 别名]
def _preprocess_request_bind(request):
# set boxName when binding the device to hostname
urlQuery = QUrlQuery(request.url())
queryItems = urlQuery.queryItems()
for i, item in enumerate(queryItems):
if item[0] == "boxName":
queryItems[i] = ("boxName", os.uname().nodename)
urlQuery.setQueryItems(queryItems)
# write changes back to request
qurl = request.url()
qurl.setQuery(urlQuery)
request.setUrl(qurl)
return request
示例5: formatUrl
# 需要导入模块: from PyQt5.QtCore import QUrlQuery [as 别名]
# 或者: from PyQt5.QtCore.QUrlQuery import setQueryItems [as 别名]
def formatUrl(self, endpoint, params={}):
url = QUrl(DIVI_HOST + endpoint)
qr = QUrlQuery()
qr.setQueryItems(list(params.items()))
url.setQuery( qr )
return url