Ticket #6393: pretty_print_6393.patch

File pretty_print_6393.patch, 593 bytes (added by gen3, 8 years ago)

the pretty print function in utils.py

  • twisted/python/util.py

     
    346346def println(*a):
    347347    sys.stdout.write(' '.join(map(str, a))+'\n')
    348348
     349def pretty_format(a,s):
     350        """ a is a list of objects
     351            s is the or/and string"""
     352        c=""
     353        for i in a[:-1]:
     354                c+=repr(i)
     355                c+=", "
     356        c+=s
     357        c+=' '
     358        c+=repr(a[-1])
     359        return c
     360
    349361# XXX
    350362# This does not belong here
    351363# But where does it belong?