1.1 --- a/examples/Common/DemoApp.py Sat Mar 04 18:51:54 2006 +0000
1.2 +++ b/examples/Common/DemoApp.py Sat Mar 04 18:52:40 2006 +0000
1.3 @@ -8,7 +8,7 @@
1.4 # Import the things which publish parts of the application.
1.5
1.6 from WebStack.Resources.ResourceMap import MapResource
1.7 -import os
1.8 +import os, sys
1.9
1.10 # Here are all the example applications.
1.11
1.12 @@ -57,8 +57,8 @@
1.13
1.14 "Define the resource mapping."
1.15
1.16 - cwd = os.getcwd()
1.17 - parts = os.path.split(cwd)
1.18 + exec_dir = os.path.split(sys.argv[0])[0]
1.19 + parts = os.path.split(exec_dir)
1.20 if parts[-1] == "tools":
1.21 parts = parts[:-1]
1.22 parts += ("docs", "LICENCE.txt")
1.23 @@ -78,4 +78,10 @@
1.24
1.25 return resource
1.26
1.27 +# Resource preparation ahead of time - useful for making installations.
1.28 +
1.29 +def prepare_resources():
1.30 + for module in [Candidate, Configurator, Dictionary, Questionnaire, PEP241, Recursive, VerySimple]:
1.31 + module.prepare_resources()
1.32 +
1.33 # vim: tabstop=4 expandtab shiftwidth=4