1.1 --- a/examples/Common/Candidate/__init__.py Sat Mar 04 18:52:40 2006 +0000
1.2 +++ b/examples/Common/Candidate/__init__.py Sat Mar 04 18:53:12 2006 +0000
1.3 @@ -265,11 +265,14 @@
1.4
1.5 # Site map initialisation.
1.6
1.7 -def get_site(fsencoding=None):
1.8 +def get_site(fsencoding=None, use_cwd=0):
1.9
1.10 "Return a simple Web site resource."
1.11
1.12 - resource_dir = os.path.join(os.path.split(__file__)[0], "Resources")
1.13 + if use_cwd:
1.14 + resource_dir = os.getcwd()
1.15 + else:
1.16 + resource_dir = os.path.join(os.path.split(__file__)[0], "Resources")
1.17 repository = DirectoryRepository(os.path.join(resource_dir, "candidates"), fsencoding)
1.18
1.19 # Get the main resource and the directory used by the application.
1.20 @@ -288,4 +291,10 @@
1.21
1.22 return resource
1.23
1.24 +# Resource preparation ahead of time - useful for making installations.
1.25 +
1.26 +def prepare_resources():
1.27 + for cls in [AdminResource, DisplayResource, CandidateResource]:
1.28 + XSLForms.Resources.WebResources.prepare_resources(cls)
1.29 +
1.30 # vim: tabstop=4 expandtab shiftwidth=4