1.1 --- a/examples/Common/Configurator/__init__.py Mon May 02 18:54:40 2005 +0000
1.2 +++ b/examples/Common/Configurator/__init__.py Mon May 02 18:55:20 2005 +0000
1.3 @@ -41,21 +41,12 @@
1.4
1.5 def respond(self, trans):
1.6
1.7 - # Produce stylesheet.
1.8 -
1.9 - if trans.get_path_info().split("/")[-1] == "styles.css":
1.10 - trans.set_content_type(WebStack.Generic.ContentType("text/css", self.encoding))
1.11 - out = trans.get_response_stream()
1.12 - f = open(os.path.join(self.resource_dir, "styles.css"), "rb")
1.13 - out.write(f.read())
1.14 - f.close()
1.15 - raise WebStack.Generic.EndOfResponse
1.16 -
1.17 global XSLForms # NOTE: Strangely required to avoid UnboundLocalError!
1.18 - method = trans.get_request_method()
1.19
1.20 # Only obtain field information according to the stated method.
1.21
1.22 + method = trans.get_request_method()
1.23 +
1.24 if method == "GET":
1.25 fields = XSLForms.Fields.Fields(encoding="iso-8859-1", values_are_lists=1)
1.26 parameters = trans.get_fields_from_path()
1.27 @@ -64,28 +55,6 @@
1.28 fields = XSLForms.Fields.Fields(encoding=self.encoding, values_are_lists=1)
1.29 parameters = trans.get_fields_from_body(self.encoding)
1.30 documents = fields.make_documents(parameters.items())
1.31 - elif method == "PROPFIND":
1.32 - dav_xsl = os.path.join(self.resource_dir, "config_dav.xsl")
1.33 - database_xml = os.path.join(self.resource_dir, "config_database.xml")
1.34 - database = libxml2dom.parse(database_xml)
1.35 -
1.36 - # Process the path.
1.37 -
1.38 - parts = trans.get_path_info().split("/")
1.39 - if not parts[-1]:
1.40 - del parts[-1]
1.41 -
1.42 - start = parts[-1]
1.43 - path = "/".join(parts)
1.44 - proc = XSLOutput.Processor([dav_xsl], parameters={
1.45 - "path" : path,
1.46 - "start" : start
1.47 - })
1.48 -
1.49 - trans.set_response_code(207)
1.50 - proc.send_output(trans.get_response_stream(), trans.get_response_stream_encoding(),
1.51 - database)
1.52 - raise WebStack.Generic.EndOfResponse
1.53 else:
1.54 trans.set_response_code(405)
1.55 raise WebStack.Generic.EndOfResponse