本文整理汇总了Python中PyQt5.QtNetwork.QNetworkAccessManager.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QNetworkAccessManager.__init__方法的具体用法?Python QNetworkAccessManager.__init__怎么用?Python QNetworkAccessManager.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtNetwork.QNetworkAccessManager
的用法示例。
在下文中一共展示了QNetworkAccessManager.__init__方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.QtNetwork import QNetworkAccessManager [as 别名]
# 或者: from PyQt5.QtNetwork.QNetworkAccessManager import __init__ [as 别名]
def __init__(self):
QNetworkAccessManager.__init__(self)
url = QUrl("http://localhost:8085/events")
req = QNetworkRequest(url)
self.reply = self.get(req)
self.reply.readyRead.connect(self.on_read_data)
self.reply.finished.connect(self.on_finished)
self.reply.error.connect(self.on_error)
示例2: __init__
# 需要导入模块: from PyQt5.QtNetwork import QNetworkAccessManager [as 别名]
# 或者: from PyQt5.QtNetwork.QNetworkAccessManager import __init__ [as 别名]
def __init__(self):
QNetworkAccessManager.__init__(self)
self.dispatch_map = {
'GET': self.perform_get,
'PATCH': self.perform_patch,
'PUT': self.perform_put,
'DELETE': self.perform_delete,
'POST': self.perform_post
}
self.protocol = DEFAULT_API_PROTOCOL
self.host = DEFAULT_API_HOST
self.port = DEFAULT_API_PORT
示例3: __init__
# 需要导入模块: from PyQt5.QtNetwork import QNetworkAccessManager [as 别名]
# 或者: from PyQt5.QtNetwork.QNetworkAccessManager import __init__ [as 别名]
def __init__(self, api_port):
QNetworkAccessManager.__init__(self)
url = QUrl("http://localhost:%d/events" % api_port)
self.request = QNetworkRequest(url)
self.failed_attempts = 0
self.connect_timer = QTimer()
self.current_event_string = ""
self.tribler_version = "Unknown"
self.reply = None
self.emitted_tribler_started = False # We should only emit tribler_started once
self.shutting_down = False
self._logger = logging.getLogger('TriblerGUI')
示例4: __init__
# 需要导入模块: from PyQt5.QtNetwork import QNetworkAccessManager [as 别名]
# 或者: from PyQt5.QtNetwork.QNetworkAccessManager import __init__ [as 别名]
def __init__(self, parent=None):
QNetworkAccessManager.__init__(self, parent)
self._dispatcher = {}
self.headers = {}
示例5: __init__
# 需要导入模块: from PyQt5.QtNetwork import QNetworkAccessManager [as 别名]
# 或者: from PyQt5.QtNetwork.QNetworkAccessManager import __init__ [as 别名]
def __init__(self, parent = None):
QNetworkAccessManager.__init__(self, parent)