当前位置: 首页>>代码示例>>Python>>正文


Python QUrlQuery.setQueryItems方法代码示例

本文整理汇总了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
开发者ID:pycom,项目名称:EricShort,代码行数:31,代码来源:AdBlockSubscription.py

示例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)
开发者ID:testmana2,项目名称:test,代码行数:30,代码来源:VirusTotalApi.py

示例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)
开发者ID:testmana2,项目名称:test,代码行数:30,代码来源:VirusTotalApi.py

示例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
开发者ID:bugmoto,项目名称:XwareDesktop,代码行数:19,代码来源:CNetworkAccessManager.py

示例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
开发者ID:gis-support,项目名称:DIVI-QGIS-Plugin,代码行数:8,代码来源:connector.py


注:本文中的PyQt5.QtCore.QUrlQuery.setQueryItems方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。