WebStack

Changeset

455:a6c7628d5a37
2005-08-25 paulb raw files shortlog changelog graph [project @ 2005-08-25 22:40:33 by paulb] Added a filesystem encoding argument for the calendar example.
examples/BaseHTTPRequestHandler/DemoApp.py (file)
     1.1 --- a/examples/BaseHTTPRequestHandler/DemoApp.py	Thu Aug 25 22:39:52 2005 +0000
     1.2 +++ b/examples/BaseHTTPRequestHandler/DemoApp.py	Thu Aug 25 22:40:33 2005 +0000
     1.3 @@ -53,6 +53,15 @@
     1.4  </html>""")
     1.5          trans.set_response_code(200)
     1.6  
     1.7 +# Get various special arguments.
     1.8 +
     1.9 +import sys
    1.10 +
    1.11 +if len(sys.argv) > 1:
    1.12 +    fsencoding = sys.argv[1]
    1.13 +else:
    1.14 +    fsencoding = None
    1.15 +
    1.16  # Define the resource mapping.
    1.17  
    1.18  resource = MapResource({
    1.19 @@ -62,7 +71,7 @@
    1.20      "simple" : SimpleResource(),
    1.21      "unicode" : UnicodeResource(),
    1.22      "verysimple" : VerySimpleResource(),
    1.23 -    "calendar" : CalendarResource(),
    1.24 +    "calendar" : CalendarResource(fsencoding),
    1.25      "" : DemoResource()
    1.26      })
    1.27