當前位置: 首頁>>代碼示例>>Python>>正文


Python client.ClientHTTP類代碼示例

本文整理匯總了Python中neubot.http.client.ClientHTTP的典型用法代碼示例。如果您正苦於以下問題:Python ClientHTTP類的具體用法?Python ClientHTTP怎麽用?Python ClientHTTP使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ClientHTTP類的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

 def __init__(self, poller):
     ClientHTTP.__init__(self, poller)
     STATE.update("test_name", "speedtest")
     self.child = None
     self.streams = collections.deque()
     self.finished = False
     self.state = None
開發者ID:DavideAllavena,項目名稱:neubot,代碼行數:7,代碼來源:client.py

示例2: __init__

 def __init__(self, ctx):
     ''' Download a file '''
     self.ctx = ctx
     ClientHTTP.__init__(self, POLLER)
     self.configure(CONFIG.copy())
     logging.debug('runner_dload: GET %s', self.ctx['uri'])
     self.connect_uri(self.ctx['uri'])
開發者ID:EverlastingFire,項目名稱:neubot,代碼行數:7,代碼來源:runner_dload.py

示例3: __init__

 def __init__(self, ctx):
     """ Download a file """
     self.ctx = ctx
     ClientHTTP.__init__(self, POLLER)
     self.configure(CONFIG.copy())
     logging.info("runner_dload: connecting to %s", self.ctx["uri"])
     self.connect_uri(self.ctx["uri"])
開發者ID:felipebusnello,項目名稱:neubot,代碼行數:7,代碼來源:runner_dload.py

示例4: connect_uri

 def connect_uri(self, uri=None, count=None):
     if not uri:
         uri = self.conf.get("speedtest.client.uri",
           "http://neubot.blupixel.net/")
     if not count:
         count = self.conf.get("speedtest.client.nconn", 1)
     LOG.info("* speedtest with %s" % uri)
     ClientHTTP.connect_uri(self, uri, count)
開發者ID:ClaudioArtusio,項目名稱:neubot,代碼行數:8,代碼來源:client.py

示例5: connect_uri

    def connect_uri(self, uri=None, count=None):
        if not uri:
            address = self.conf["bittorrent.address"]
            port = self.conf["bittorrent.negotiate.port"]
            uri = "http://%s:%s/" % (address, port)

        LOG.start("BitTorrent: connecting to %s" % uri)

        ClientHTTP.connect_uri(self, uri, 1)
開發者ID:DavideAllavena,項目名稱:neubot,代碼行數:9,代碼來源:client.py

示例6: connect_uri

    def connect_uri(self, uri=None, count=None):
        if not uri:
            address = self.conf["bittorrent.address"]
            port = self.conf["bittorrent.negotiate.port"]
            uri = "http://%s:%s/" % (address, port)

        logging.info("BitTorrent: connecting to %s in progress...", uri)

        ClientHTTP.connect_uri(self, uri, 1)
開發者ID:felipebusnello,項目名稱:neubot,代碼行數:9,代碼來源:client.py

示例7: __init__

 def __init__(self, poller):
     ClientHTTP.__init__(self, poller)
     STATE.update("test_latency", "---", publish=False)
     STATE.update("test_download", "---", publish=False)
     STATE.update("test_upload", "---", publish=False)
     STATE.update("test_name", "speedtest")
     self.child = None
     self.streams = collections.deque()
     self.finished = False
     self.state = None
開發者ID:felipebusnello,項目名稱:neubot,代碼行數:10,代碼來源:client.py

示例8: __init__

    def __init__(self, poller, parent, rates):
        ClientHTTP.__init__(self, poller)
        self.parent = parent
        self.rates = rates

        STATE.update("test_latency", "---", publish=False)
        STATE.update("test_download", "---", publish=False)
        STATE.update("test_upload", "N/A", publish=False)
        STATE.update("test_progress", "0%", publish=False)
        STATE.update("test_name", "dash", publish=False)
        STATE.update("test")

        self.iteration = 0
        self.rate_kbit = 0
        self.speed_kbit = 100
        self.saved_ticks = 0.0
        self.saved_cnt = 0
        self.saved_times = 0
開發者ID:neubot,項目名稱:neubot,代碼行數:18,代碼來源:client_smpl.py

示例9: __init__

    def __init__(self, poller):
        ClientHTTP.__init__(self, poller)

        STATE.update("test_latency", "---", publish=False)
        STATE.update("test_download", "---", publish=False)
        STATE.update("test_upload", "---", publish=False)
        STATE.update("test_progress", "0%", publish=False)
        STATE.update("test_name", "dash")

        self.state = STATE_NEGOTIATE

        self.stream = None
        self.measurements = []
        self.client = None

        self.authorization = ""
        self.real_address = ""
        self.queue_pos = 0
        self.unchoked = False

        self.iterations = 0
開發者ID:EverlastingFire,項目名稱:neubot,代碼行數:21,代碼來源:client_negotiate.py

示例10: connect

 def connect(self, endpoint, count=1):
     if count != 1:
         raise RuntimeError("dash: invalid count")
     logging.info("dash: negotiate with: %s",
         utils_net.format_epnt(endpoint))
     ClientHTTP.connect(self, endpoint, count)
開發者ID:EverlastingFire,項目名稱:neubot,代碼行數:6,代碼來源:client_negotiate.py

示例11: configure

 def configure(self, conf, measurer=None):
     if measurer:
         LOG.info("* speedtest: ignoring upstream measurer")
     ClientHTTP.configure(self, conf, self.measurer)
開發者ID:ClaudioArtusio,項目名稱:neubot,代碼行數:4,代碼來源:client.py

示例12: __init__

 def __init__(self, poller):
     ClientHTTP.__init__(self, poller)
     self.timestamp = 0
     self.uri = ""
     self.stop = False
開發者ID:ClaudioArtusio,項目名稱:neubot,代碼行數:5,代碼來源:client.py


注:本文中的neubot.http.client.ClientHTTP類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。