| " + self.escape(key) + " | ",
value = form[key]
if type(value) in types.StringTypes:
print >>outs,"str | ",self.escape(value)
elif type(value)==type([]):
print >>outs,"list | ",' | '.join( [ self.escape(v) for v in value] )
elif isinstance(value, FormUploadedFile):
print >>outs,"uploaded file | "
print >>outs, ""
print >>outs, "| filename | ",value.filename," | "
print >>outs, "| mimeType | ",value.mimeType," | "
print >>outs, "| typeOptions | ",value.typeOptions," | "
print >>outs, "| disposition | ",value.disposition," | "
print >>outs, "| disposition_options | ",value.dispositionOptions," | "
contents=value.file.read(2000)
print >>outs,"| content size | ",len(contents)
if value.file.read(1):
truncated=True
print >>outs,"(truncated to 2000!!)"
else:
truncated=False
print >>outs, " | "
if truncated:
print >>outs, "| partial content | ",
else:
print >>outs, " | | content | ",
if value.mimeType.startswith("text/"):
print >>outs,""+self.escape(contents)
if truncated:
print >>outs," …"
print >>outs," | "
else:
print >>outs,"not shown (binary data)"
print >>outs," "
print >>outs," |
"
print >>outs, "