# HG changeset patch # User paulb # Date 1093650742 0 # Node ID cff4a3578d40550aba2bfb81fff50a1652b84ea6 # Parent c23c3ee00618a5dd43e487dc80db67a1e1380aa3 [project @ 2004-08-27 23:52:22 by paulb] Removed the display of the input data. diff -r c23c3ee00618 -r cff4a3578d40 examples/Common/Form/__init__.py --- a/examples/Common/Form/__init__.py Fri Aug 27 23:52:06 2004 +0000 +++ b/examples/Common/Form/__init__.py Fri Aug 27 23:52:22 2004 +0000 @@ -19,8 +19,12 @@ # NOTE: Some frameworks do not pass in the content type. content_type = trans.get_content_type() - input = trans.get_request_stream() - received_data = input.read() + if content_type: + content_type_str = content_type.content_type + else: + content_type_str = None + + fields = trans.get_fields_from_body() # NOTE: Send the appropriate kind of response. @@ -51,12 +55,25 @@

Content Type

%s

-

Received Data

-

Start

-
%s
-

Stop

+

Fields from Body

+ -""" % (content_type.content_type, received_data.replace("<", "<").replace(">", ">").replace("&", "&"))) +""" % ( + content_type_str, + self._format_fields(fields) + )) + + def _format_fields(self, d): + return "".join([ + "
  • %s
  • " % (key, self._format_list(value)) + for key, value in d.items() + ]) + + def _format_list(self, l): + return "".join([ + "
  • %s
  • " % value + for value in l + ]) # vim: tabstop=4 expandtab shiftwidth=4