Did I find the right examples for you? yes no

All Samples(9)  |  Call(5)  |  Derive(0)  |  Import(4)
Converts an IPP tuple to an IPP string
ippstr(('1.2.3.4', 5678)) == '1.2.3.4:5678'

        def ippstr(ipp):
    '''
    Converts an IPP tuple to an IPP string
    ippstr(('1.2.3.4', 5678)) == '1.2.3.4:5678'
    '''
    return ipp[0] + ':' + str(ipp[1])
        


src/p/y/pylehash-HEAD/pylehash/switch.py   pylehash(Download)
from .telex import Telex
from .end import End, EndManager
from .util import ippstr
 
class Switch(DatagramProtocol):
    def handle(self, telex, ipp, bytes):
        '''
        Runs the given telex and sender by all our current handlers.
        '''
        print "<<", ippstr(ipp), ":", telex.dumps()
        '''
        if telex and to:
            telex['_to'] = ippstr(to.ipp)
            telex['_br'] = to.bytes_received
            print ">>", ippstr(to.ipp), ":", telex.dumps()

src/p/y/pylehash-HEAD/pylehash/hash.py   pylehash(Download)
from hashlib import sha1
from math import floor, log
from .util import ippstr
from .end import End
 
def hexhash(end):
    if isinstance(end, End):
        return hexhash(end.ipp)
    elif isinstance(end, tuple):
        return hexhash(ippstr(end))

src/p/y/pylehash-HEAD/pylehash/handlers.py   pylehash(Download)
 
from .telex import Telex
from .util import ippstr, ipptup
from .end import End
 
    def handle(self, telex, from_end, switch):
        sees = map(lambda e: ippstr(e.ipp), switch.ends.near(telex['+end']))
        t = Telex(other_dict={'.see':sees})
        switch.send(telex=t, to=from_end)
 

src/p/y/pylehash-HEAD/pylehash/__init__.py   pylehash(Download)
 
from twisted.internet import reactor
from .util import ippstr, ipptup
from .telex import Telex
from .switch import Switch