# HG changeset patch # User paulb # Date 1141498360 0 # Node ID 7ae28486c97ab7d7af8ae8a381cf91f944d64f7f # Parent 5dee872a895b745bdf3fea96c671226026297a90 [project @ 2006-03-04 18:52:40 by paulb] Added a prepare_resources function. Fixed discovery of the examples. diff -r 5dee872a895b -r 7ae28486c97a examples/Common/DemoApp.py --- a/examples/Common/DemoApp.py Sat Mar 04 18:51:54 2006 +0000 +++ b/examples/Common/DemoApp.py Sat Mar 04 18:52:40 2006 +0000 @@ -8,7 +8,7 @@ # Import the things which publish parts of the application. from WebStack.Resources.ResourceMap import MapResource -import os +import os, sys # Here are all the example applications. @@ -57,8 +57,8 @@ "Define the resource mapping." - cwd = os.getcwd() - parts = os.path.split(cwd) + exec_dir = os.path.split(sys.argv[0])[0] + parts = os.path.split(exec_dir) if parts[-1] == "tools": parts = parts[:-1] parts += ("docs", "LICENCE.txt") @@ -78,4 +78,10 @@ return resource +# Resource preparation ahead of time - useful for making installations. + +def prepare_resources(): + for module in [Candidate, Configurator, Dictionary, Questionnaire, PEP241, Recursive, VerySimple]: + module.prepare_resources() + # vim: tabstop=4 expandtab shiftwidth=4