1.1 --- a/examples/Common/Configurator/__init__.py Tue May 03 18:12:06 2005 +0000
1.2 +++ b/examples/Common/Configurator/__init__.py Tue May 03 18:14:34 2005 +0000
1.3 @@ -46,6 +46,7 @@
1.4 # Only obtain field information according to the stated method.
1.5
1.6 method = trans.get_request_method()
1.7 + path_info = trans.get_path_info()
1.8
1.9 if method == "GET":
1.10 fields = XSLForms.Fields.Fields(encoding="iso-8859-1", values_are_lists=1)
1.11 @@ -53,8 +54,15 @@
1.12 documents = fields.make_documents(parameters.items())
1.13 elif method == "POST":
1.14 fields = XSLForms.Fields.Fields(encoding=self.encoding, values_are_lists=1)
1.15 - parameters = trans.get_fields_from_body(self.encoding)
1.16 + if path_info == "/cpu":
1.17 + text = trans.get_request_stream().read()
1.18 + text_parts = text.split("=")
1.19 + text_name, text_values = text_parts[0], ["=".join(text_parts[1:])]
1.20 + parameters = {text_name : text_values}
1.21 + else:
1.22 + parameters = trans.get_fields_from_body(self.encoding)
1.23 documents = fields.make_documents(parameters.items())
1.24 + print "*", libxml2dom.toString(documents["configuration"])
1.25 else:
1.26 trans.set_response_code(405)
1.27 raise WebStack.Generic.EndOfResponse