From a0fb321e6d09b4516057908594ac94382ece9997 Mon Sep 17 00:00:00 2001 From: grbd Date: Tue, 1 Aug 2017 14:49:43 +0100 Subject: Update to user manual on how to use sys.path for toolpath, and toolpath in general also small update to tests --- doc/user/builders-writing.xml | 47 ---------------- doc/user/environments.xml | 124 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+), 47 deletions(-) (limited to 'doc') diff --git a/doc/user/builders-writing.xml b/doc/user/builders-writing.xml index 35dd989d..07f2dec6 100644 --- a/doc/user/builders-writing.xml +++ b/doc/user/builders-writing.xml @@ -880,53 +880,6 @@ env2.Foo('file2') -
- Nested and namespace builders; - - - &SCons; now supports the ability for a Builder to be located within a sub-directory of the toolpath. - This is similar to namespacing within python. - - Normally when loading a tool into the environment, scons will search for the tool within two locations - - - -# Regular non namespace target -env = Environment(ENV = os.environ, tools = ['SomeTool']) -env.SomeTool(targets, sources) - - - - The locations would include - SCons\Tool\SomeTool.py - SCons\Tool\SomeTool\__init__.py - .\site_scons\site_tools\SomeTool.py - .\site_scons\site_tools\SomeTool\__init__.py - - If a toolpath is specified this is also searched as well. - With nested or namespaced tools we can use the dot notation to specify a sub-directoty that the tool is located under - - - -# namespaced target -env = Environment(ENV = os.environ, tools = ['SubDir1.SubDir2.SomeTool']) -env.SomeTool(targets, sources) - - - - With this example the search locations would include - SCons\Tool\SubDir1\SubDir2\SomeTool.py - SCons\Tool\SubDir1\SubDir2\SomeTool\__init__.py - .\site_scons\site_tools\SubDir1\SubDir2\SomeTool.py - .\site_scons\site_tools\SubDir1\SubDir2\SomeTool\__init__.py - - It's important to note when creating tools within sub-directories, there needs to be a __init__.py file within each directory. - This file can just be empty however. - This is the same constraint used by python when loading modules from within sub-directories (packages). - - -
-