Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(22)  |  Call(15)  |  Derive(0)  |  Import(7)

src/d/h/DHTBot-HEAD/dhtbot/coding/krpc_coder.py   DHTBot(Download)
from dhtbot.coding import basic_coder
from dhtbot.coding.bencode import bdecode, bencode, BTFailure
from dhtbot.krpc_types import Query, Response, Error
 
class InvalidKRPCError(Exception):
 
    """
    r = Response()
    # All responses have querier IDs
    r._from = basic_coder.decode_network_id(rpc_dict['r']['id'])

src/d/h/DHTBot-HEAD/dhtbot/protocols/krpc_sender.py   DHTBot(Download)
from dhtbot.coding import krpc_coder
from dhtbot.coding.krpc_coder import InvalidKRPCError
from dhtbot.krpc_types import Query, Response, Error
from dhtbot.transaction import Transaction
from dhtbot.protocols.errors import TimeoutError, KRPCError 

src/d/h/DHTBot-HEAD/dhtbot/test/test_krpc_types.py   DHTBot(Download)
from twisted.trial import unittest
 
from dhtbot.krpc_types import _KRPC, Query, Response, Error
 
class KRPCTestCase(unittest.TestCase):
    def setUp(self):
        r = Response()
        r2 = Response()
        r2._transaction_id = r._transaction_id = 18095
        r2._from = r._from = 15

src/d/h/DHTBot-HEAD/dhtbot/test/protocols/test_krpc_sender.py   DHTBot(Download)
from twisted.trial import unittest
from twisted.python.monkey import MonkeyPatcher
 
from dhtbot.krpc_types import Query, Response, Error
from dhtbot.kademlia.routing_table import TreeRoutingTable

src/d/h/DHTBot-HEAD/dhtbot/test/protocols/test_krpc_responder.py   DHTBot(Download)
from dhtbot import constants, contact
from dhtbot.coding import krpc_coder
from dhtbot.krpc_types import Query, Response
from dhtbot.protocols import krpc_responder, krpc_sender
from dhtbot.protocols.krpc_responder import KRPC_Responder, _TokenGenerator
        incoming_query._from = 123
        incoming_query._transaction_id = 15
        expected_response = Response()
        expected_response._from = kresponder.node_id
        expected_response._transaction_id = 15
        incoming_query.target_id = 777777
 
        expected_response = Response()
        expected_response._from = kresponder.node_id
        expected_response._transaction_id = 15
        incoming_query.target_id = target_id
 
        expected_response = Response()
        expected_response._from = kresponder.node_id
        expected_response._transaction_id = 15
        # and the response (that the node sends)
        # matches what we made
        expected_response = Response()
        expected_response._from = kresponder.node_id
        expected_response._transaction_id = incoming_query._transaction_id

src/d/h/DHTBot-HEAD/dhtbot/test/protocols/test_krpc_iterator.py   DHTBot(Download)
# Imported so that the reactor can be patched out
from dhtbot.protocols import krpc_sender
from dhtbot.krpc_types import Response
from dhtbot.protocols.errors import TimeoutError
 

src/d/h/DHTBot-HEAD/dhtbot/test/coding/test_krpc_coder.py   DHTBot(Download)
        InvalidKRPCError)
from dhtbot.coding import basic_coder
from dhtbot.krpc_types import Query, Response, Error
from dhtbot.contact import Node
 
    def test_encode_validGetPeersResponseWithPeers(self):
        r = Response()
        r._transaction_id = 1903890316316
        r._from = 169031860931900138093217073128059
        r.token = 90831
    def test_encode_and_decode_validGetPeersResponseWithPeers(self):
        r = Response()
        r._transaction_id = 1903890316316
        r._from = 169031860931900138093217073128059
        r.token = 90831
    def test_encode_validGetPeersResponseWithNodes(self):
        r = Response()
        r._transaction_id = 1903890316316
        r._from = 169031860931900138093217073128059
        r.token = 90831
    def test_encode_and_decode_validPingResponse(self):
        r = Response()
        r._transaction_id = 2095
        r._from = 2**15
        processed_response = encode_and_decode(r)