# HG changeset patch # User paulb # Date 1141499310 0 # Node ID 882c729af291632c937fe33e06f91662bf1b1d48 # Parent b8dbd4c49ce576a05453f36f1efcad8ec877de57 [project @ 2006-03-04 19:08:30 by paulb] Introduced changes to make the Candidate example run from an installation. diff -r b8dbd4c49ce5 -r 882c729af291 examples/Common/DemoApp.py --- a/examples/Common/DemoApp.py Sat Mar 04 19:08:07 2006 +0000 +++ b/examples/Common/DemoApp.py Sat Mar 04 19:08:30 2006 +0000 @@ -57,6 +57,8 @@ "Define the resource mapping." + # Find a file for use with the Dictionary example. + exec_dir = os.path.split(sys.argv[0])[0] parts = os.path.split(exec_dir) if parts[-1] == "tools": @@ -65,8 +67,15 @@ doc = os.path.join(*parts) dict = Dict(doc) + # Define the site resource itself. + resource = MapResource({ - "candidate" : Candidate.get_site(), + + # NOTE: Change the filesystem encoding if appropriate. + # Use the current working directory so that the installed package can still run + # the demo. + + "candidate" : Candidate.get_site("iso-8859-15", use_cwd=1), "configurator" : Configurator.get_site(), "dictionary" : Dictionary.get_site(dict), "questionnaire" : Questionnaire.get_site(),