colorhash fix

This commit is contained in:
Roman Zeyde
2014-07-20 11:26:59 +03:00
parent 893e0b0ff2
commit fbbf9fcffe

View File

@@ -9,9 +9,9 @@ for line in lines:
try: try:
data = binascii.unhexlify(head) data = binascii.unhexlify(head)
data = map(ord, data) data = map(ord, data)
bars = ['\033[48;5;%dm \033[m' % (x,) for x in data] bars = ['\033[48;5;%dm%02x\033[m' % (x, x) for x in data]
bars = ''.join(bars) head = ''.join(bars)
except TypeError: except TypeError:
pass pass
print('%s: %s %s' % (bars, head, tail)) print('%s %s' % (head, tail))