1.1 --- a/examples/Common/Dictionary/__init__.py Sun Jan 21 00:22:40 2007 +0000
1.2 +++ b/examples/Common/Dictionary/__init__.py Sun Jan 21 00:23:27 2007 +0000
1.3 @@ -10,8 +10,13 @@
1.4 # Site map imports.
1.5
1.6 from WebStack.Resources.ResourceMap import MapResource
1.7 +from WebStack.Resources.Selectors import EncodingSelector
1.8 from WebStack.Resources.Static import DirectoryResource
1.9
1.10 +# Configuration setting.
1.11 +
1.12 +encoding = "utf-8"
1.13 +
1.14 # Resource classes.
1.15
1.16 class DictionaryResource(XSLForms.Resources.WebResources.XSLFormsResource):
1.17 @@ -19,7 +24,6 @@
1.18 "A simple resource providing dictionary lookup."
1.19
1.20 resource_dir = os.path.join(os.path.split(__file__)[0], "Resources")
1.21 - encoding = "utf-8"
1.22 template_resources = {
1.23 "words" : ("words_template.xhtml", "words_output.xsl")
1.24 }
1.25 @@ -111,7 +115,7 @@
1.26
1.27 # Start the response.
1.28
1.29 - trans.set_content_type(WebStack.Generic.ContentType("application/xhtml+xml", self.encoding))
1.30 + trans.set_content_type(WebStack.Generic.ContentType("application/xhtml+xml", encoding))
1.31
1.32 # Ensure that an output stylesheet exists.
1.33
1.34 @@ -154,7 +158,7 @@
1.35 "matches" : dictionary_resource
1.36 })
1.37
1.38 - return resource
1.39 + return EncodingSelector(resource, encoding)
1.40
1.41 # Resource preparation ahead of time - useful for making installations.
1.42