1.1 --- a/examples/BaseHTTPRequestHandler/CalendarApp.py Mon Nov 14 14:41:14 2005 +0000
1.2 +++ b/examples/BaseHTTPRequestHandler/CalendarApp.py Mon Nov 14 14:41:40 2005 +0000
1.3 @@ -4,6 +4,10 @@
1.4 from Calendar import CalendarResource
1.5
1.6 print "Serving..."
1.7 +
1.8 +# Choose or customise one of the following if the example fails.
1.9 +
1.10 deploy(CalendarResource())
1.11 +#deploy(CalendarResource("iso-8859-1"))
1.12
1.13 # vim: tabstop=4 expandtab shiftwidth=4
2.1 --- a/examples/CGI/CalendarHandler.py Mon Nov 14 14:41:14 2005 +0000
2.2 +++ b/examples/CGI/CalendarHandler.py Mon Nov 14 14:41:40 2005 +0000
2.3 @@ -9,6 +9,9 @@
2.4 from WebStack.Adapters.CGI import deploy
2.5 from Calendar import CalendarResource
2.6
2.7 +# Choose or customise one of the following if the example fails.
2.8 +
2.9 deploy(CalendarResource())
2.10 +#deploy(CalendarResource("iso-8859-1"))
2.11
2.12 # vim: tabstop=4 expandtab shiftwidth=4
3.1 --- a/examples/Common/Calendar/__init__.py Mon Nov 14 14:41:14 2005 +0000
3.2 +++ b/examples/Common/Calendar/__init__.py Mon Nov 14 14:41:40 2005 +0000
3.3 @@ -18,7 +18,7 @@
3.4 resource_dir = os.path.join(os.path.split(__file__)[0], "calendars")
3.5 encoding = "utf-8"
3.6
3.7 - def __init__(self):
3.8 + def __init__(self, fsencoding=None):
3.9 if not os.path.exists(self.resource_dir):
3.10 try:
3.11 os.mkdir(self.resource_dir)
3.12 @@ -27,11 +27,19 @@
3.13 if not os.path.exists(self.resource_dir):
3.14 os.mkdir(self.resource_dir)
3.15
3.16 - if os.path.supports_unicode_filenames:
3.17 - self.fsencoding = None
3.18 + # Guess the filesystem encoding.
3.19 +
3.20 + if fsencoding is None:
3.21 + if os.path.supports_unicode_filenames:
3.22 + self.fsencoding = None
3.23 + else:
3.24 + import locale
3.25 + self.fsencoding = locale.getdefaultlocale()[1]
3.26 +
3.27 + # Or override any guesses.
3.28 +
3.29 else:
3.30 - import locale
3.31 - self.fsencoding = locale.getdefaultlocale()[1]
3.32 + self.fsencoding = fsencoding
3.33
3.34 def _convert_name(self, name):
3.35 if self.fsencoding:
4.1 --- a/examples/JavaServlet/CalendarApp.py Mon Nov 14 14:41:14 2005 +0000
4.2 +++ b/examples/JavaServlet/CalendarApp.py Mon Nov 14 14:41:40 2005 +0000
4.3 @@ -7,7 +7,11 @@
4.4 class CalendarApp(HttpServlet):
4.5 def __init__(self):
4.6 HttpServlet.__init__(self)
4.7 +
4.8 + # Choose or customise one of the following if the example fails.
4.9 +
4.10 self.dispatcher = JavaServlet.Dispatcher(CalendarResource())
4.11 + #self.dispatcher = JavaServlet.Dispatcher(CalendarResource("iso-8859-1"))
4.12
4.13 def service(self, request, response):
4.14 self.dispatcher.service(request, response)
5.1 --- a/examples/ModPython/CalendarApp/CalendarHandler.py Mon Nov 14 14:41:14 2005 +0000
5.2 +++ b/examples/ModPython/CalendarApp/CalendarHandler.py Mon Nov 14 14:41:40 2005 +0000
5.3 @@ -10,8 +10,10 @@
5.4 from Calendar import CalendarResource
5.5
5.6 # NOTE: Not sure if the resource should be maintained in a resource pool.
5.7 +# Choose or customise one of the following if the example fails.
5.8
5.9 resource = CalendarResource()
5.10 +#resource = CalendarResource("iso-8859-1")
5.11
5.12 def handler(req):
5.13 global resource
6.1 --- a/examples/Twisted/CalendarApp.py Mon Nov 14 14:41:14 2005 +0000
6.2 +++ b/examples/Twisted/CalendarApp.py Mon Nov 14 14:41:40 2005 +0000
6.3 @@ -4,6 +4,10 @@
6.4 from Calendar import CalendarResource
6.5
6.6 print "Serving..."
6.7 +
6.8 +# Choose or customise one of the following if the example fails.
6.9 +
6.10 deploy(CalendarResource())
6.11 +#deploy(CalendarResource("iso-8859-1"))
6.12
6.13 # vim: tabstop=4 expandtab shiftwidth=4
7.1 --- a/examples/WSGI/CalendarHandler.py Mon Nov 14 14:41:14 2005 +0000
7.2 +++ b/examples/WSGI/CalendarHandler.py Mon Nov 14 14:41:40 2005 +0000
7.3 @@ -9,6 +9,9 @@
7.4 from WebStack.Adapters.WSGI import deploy
7.5 from Calendar import CalendarResource
7.6
7.7 +# Choose or customise one of the following if the example fails.
7.8 +
7.9 deploy(CalendarResource())
7.10 +#deploy(CalendarResource("iso-8859-1"))
7.11
7.12 # vim: tabstop=4 expandtab shiftwidth=4
8.1 --- a/examples/Webware/CalendarApp/__init__.py Mon Nov 14 14:41:14 2005 +0000
8.2 +++ b/examples/Webware/CalendarApp/__init__.py Mon Nov 14 14:41:40 2005 +0000
8.3 @@ -10,8 +10,10 @@
8.4 from Calendar import CalendarResource
8.5
8.6 # NOTE: Initialising a shared resource.
8.7 +# Choose or customise one of the following if the example fails.
8.8
8.9 resource = CalendarResource()
8.10 +#resource = CalendarResource("iso-8859-1")
8.11
8.12 def InstallInWebKit(appServer):
8.13 global resource
9.1 --- a/examples/Webware/CalendarContext/__init__.py Mon Nov 14 14:41:14 2005 +0000
9.2 +++ b/examples/Webware/CalendarContext/__init__.py Mon Nov 14 14:41:40 2005 +0000
9.3 @@ -8,8 +8,11 @@
9.4 from Calendar import CalendarResource
9.5
9.6 # NOTE: Initialising a shared resource.
9.7 +# Choose or customise one of the following if the example fails.
9.8
9.9 resource = CalendarResource()
9.10 +#resource = CalendarResource("iso-8859-1")
9.11 +
9.12 urlParser = WebStackURLParser(resource)
9.13
9.14 # vim: tabstop=4 expandtab shiftwidth=4
10.1 --- a/examples/Zope/CalendarProduct/__init__.py Mon Nov 14 14:41:14 2005 +0000
10.2 +++ b/examples/Zope/CalendarProduct/__init__.py Mon Nov 14 14:41:40 2005 +0000
10.3 @@ -9,7 +9,11 @@
10.4 class CalendarProduct(WebStackAdapterProduct):
10.5 meta_type = "Calendar product"
10.6 def __init__(self, id):
10.7 +
10.8 + # Choose or customise one of the following if the example fails.
10.9 +
10.10 WebStackAdapterProduct.__init__(self, id, CalendarResource())
10.11 + #WebStackAdapterProduct.__init__(self, id, CalendarResource("iso-8859-1"))
10.12
10.13 InitializeClass(CalendarProduct)
10.14