Moved Docker stuff to "Docker" folder
Created k8s folder for k8s stuff Added early-stage service.yaml for K8s deployment
This commit is contained in:
32
Docker/src/python/tHome/util/hex/dump.py
Normal file
32
Docker/src/python/tHome/util/hex/dump.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#===========================================================================
|
||||
#
|
||||
# Dump hex bytes to a table.
|
||||
#
|
||||
#===========================================================================
|
||||
import StringIO
|
||||
|
||||
#===========================================================================
|
||||
def dump( buf ):
|
||||
"""Input is bytes buffer,
|
||||
|
||||
Returns a string w/ the hex values in a table
|
||||
"""
|
||||
# Convert to hex characters
|
||||
h = [ i.encode( "hex" ).upper() for i in buf ]
|
||||
|
||||
f = StringIO.StringIO()
|
||||
f.write( "---: 00 01 02 03 04 05 06 07 08 09\n" )
|
||||
|
||||
for i in range( len( h ) ):
|
||||
if i % 10 == 0:
|
||||
if i > 0:
|
||||
f.write( "\n" )
|
||||
f.write( "%03d: " % i )
|
||||
|
||||
f.write( "%2s " % h[i] )
|
||||
|
||||
f.write( "\n" )
|
||||
|
||||
return f.getvalue()
|
||||
|
||||
#===========================================================================
|
||||
Reference in New Issue
Block a user