summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ea36e70)
Make printmimestructure work in python3 as well as python2.
# If you want to number the parts, i suggest piping the output through
# something like "cat -n"
# If you want to number the parts, i suggest piping the output through
# something like "cat -n"
+from __future__ import print_function
+
if d[0] in [ 'attachment', 'inline' ]:
disposition = ' ' + d[0]
if (z.is_multipart()):
if d[0] in [ 'attachment', 'inline' ]:
disposition = ' ' + d[0]
if (z.is_multipart()):
- print prefix + '┬╴' + z.get_content_type() + cset + disposition + fname, z.as_string().__len__().__str__() + ' bytes'
+ print(prefix + '┬╴' + z.get_content_type() + cset + disposition + fname, z.as_string().__len__().__str__() + ' bytes')
if prefix.endswith('└'):
prefix = prefix.rpartition('└')[0] + ' '
if prefix.endswith('├'):
if prefix.endswith('└'):
prefix = prefix.rpartition('└')[0] + ' '
if prefix.endswith('├'):
test(parts[i], prefix + '└')
# FIXME: show epilogue?
else:
test(parts[i], prefix + '└')
# FIXME: show epilogue?
else:
- print prefix + '─╴'+ z.get_content_type() + cset + disposition + fname, z.get_payload().__len__().__str__(), 'bytes'
+ print(prefix + '─╴'+ z.get_content_type() + cset + disposition + fname, z.get_payload().__len__().__str__(), 'bytes')
test(email.message_from_file(sys.stdin), '└')
test(email.message_from_file(sys.stdin), '└')