Did I find the right examples for you? yes no

All Samples(5)  |  Call(3)  |  Derive(0)  |  Import(2)
Convert a binary buffer into a hexadecimal representation

        def hexline(data):
    """Convert a binary buffer into a hexadecimal representation"""
    LOGFILTER=''.join([(len(repr(chr(x)))==3) and chr(x) or \
                       '.' for x in range(256)])
    src = ''.join(data)
    hexa = ' '.join(["%02x"%ord(x) for x in src])
    printable = src.translate(LOGFILTER)
    return "(%d) %s : %s" % (len(data), hexa, printable)
        


src/p/y/pybootd-HEAD/pybootd/pxed.py   pybootd(Download)
from binascii import hexlify
from pybootd import PRODUCT_NAME
from util import hexline, to_bool, iptoint, inttoip, get_iface_config
 
BOOTP_PORT_REQUEST = 67
                option = DHCP_OPTIONS[tag]
                self.log.debug(" option %d: '%s', size:%d %s" % \
                               (tag, option, length, hexline(value)))
            except KeyError:
                self.log.error('  unknown option %d, size:%d %s:' % \
                                (tag, length, hexline(value)))

src/p/y/pybootd-HEAD/pybootd/tftpd.py   pybootd(Download)
from cStringIO import StringIO
from pybootd import pybootd_path
from util import hexline
 
__all__ = ['TftpServer']
    def handle_err(self, pkt):
        self.log.info('Error packet: %s' % hexline(pkt['errtxt']))
 
    @staticmethod
    def is_url(path):