aboutsummaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
authorhenryk <henryk@f711b948-2313-0410-aaa9-d29f33439f0b>2005-09-28 17:41:50 +0000
committerhenryk <henryk@f711b948-2313-0410-aaa9-d29f33439f0b>2005-09-28 17:41:50 +0000
commitebeb989e388966502a72836c1f183a6c1e520b29 (patch)
tree182d6666ddfa7328015e23e517d6e2889d268b36 /utils.py
parent4535fd115af1261bd481f60d82e01339ed949048 (diff)
Less characters to print (especially tabs and line breaks)
git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@9 f711b948-2313-0410-aaa9-d29f33439f0b
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils.py b/utils.py
index 98da35a..2eb760d 100644
--- a/utils.py
+++ b/utils.py
@@ -1,5 +1,6 @@
import pycsc, string, binascii, sys
+_myprintable = " " + string.letters + string.digits + string.punctuation
def hexdump(data, indent = 0, short = False):
r"""Generates a nice hexdump of data and returns it. Consecutive lines will
be indented with indent spaces. When short is true, will instead generate
@@ -14,7 +15,7 @@ def hexdump(data, indent = 0, short = False):
return " ".join([binascii.b2a_hex(a) for a in data])
def printable(data):
- return "".join([e in string.printable and e or "." for e in data])
+ return "".join([e in _myprintable and e or "." for e in data])
if short:
return "%s (%s)" % (hexable(data), printable(data))