summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-03-17 13:05:36 (GMT)
committerSteven Knight <knight@baldmt.com>2005-03-17 13:05:36 (GMT)
commitea89584a1d90770769dfa1c5462c189b61298bb2 (patch)
tree757ce333916f7ca07e6fee70f76c561c65bc2b3d /src/engine/SCons
parent7e4b4c01d69a2d2a776abb49db68507706ded50e (diff)
downloadSCons-ea89584a1d90770769dfa1c5462c189b61298bb2.zip
SCons-ea89584a1d90770769dfa1c5462c189b61298bb2.tar.gz
SCons-ea89584a1d90770769dfa1c5462c189b61298bb2.tar.bz2
Restore (some) old SCons.Script.* names, some released SConscript files are using them.
Diffstat (limited to 'src/engine/SCons')
-rw-r--r--src/engine/SCons/Script/SConscript.py10
-rw-r--r--src/engine/SCons/Script/__init__.py53
2 files changed, 62 insertions, 1 deletions
diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py
index d0df6a3..07dfd55 100644
--- a/src/engine/SCons/Script/SConscript.py
+++ b/src/engine/SCons/Script/SConscript.py
@@ -55,6 +55,16 @@ import traceback
import types
import UserList
+# The following variables used to live in this module. Some
+# SConscript files out there may have referred to them directly as
+# SCons.Script.SConscript.*. This is now supported by some special
+# handling towards the bottom of the SConscript.__init__.py module.
+#Arguments = {}
+#ArgList = []
+#BuildTargets = TargetList()
+#CommandLineTargets = []
+#DefaultTargets = []
+
launch_dir = os.path.abspath(os.curdir)
GlobalDict = None
diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py
index 9de951b..4327ac2 100644
--- a/src/engine/SCons/Script/__init__.py
+++ b/src/engine/SCons/Script/__init__.py
@@ -77,6 +77,41 @@ import Main
main = Main.main
+# The following are global class definitions and variables that used to
+# live directly in this module back before 0.96.90, when it contained
+# a lot of code. Some SConscript files in widely-distributed packages
+# (Blender is the specific example) actually reached into SCons.Script
+# directly to use some of these. Rather than break those SConscript
+# files, we're going to propagate these names into the SCons.Script
+# namespace here.
+#
+# Some of these are commented out because it's *really* unlikely anyone
+# used them, but we're going to leave the comment here to try to make
+# it obvious what to do if the situation arises.
+BuildTask = Main.BuildTask
+CleanTask = Main.CleanTask
+QuestionTask = Main.QuestionTask
+#PrintHelp = Main.PrintHelp
+OptParser = Main.OptParser
+SConscriptSettableOptions = Main.SConscriptSettableOptions
+
+keep_going_on_error = Main.keep_going_on_error
+print_dtree = Main.print_dtree
+print_explanations = Main.print_explanations
+print_includes = Main.print_includes
+print_objects = Main.print_objects
+print_time = Main.print_time
+print_tree = Main.print_tree
+memory_stats = Main.memory_stats
+ignore_errors = Main.ignore_errors
+#sconscript_time = Main.sconscript_time
+#command_time = Main.command_time
+#exit_status = Main.exit_status
+#profiling = Main.profiling
+repositories = Main.repositories
+#num_jobs = Main.num_jobs # settable by SConscript.SetJobs()
+
+#
import SConscript
_SConscript = SConscript
@@ -206,7 +241,7 @@ GlobalDefaultEnvironmentFunctions = [
'GetOption',
'Help',
'Import',
- 'SConscript',
+ #'SConscript', is handled separately, below.
'SConscriptChdir',
'SetOption',
@@ -274,6 +309,22 @@ GlobalDefaultBuilders = [
for name in GlobalDefaultEnvironmentFunctions + GlobalDefaultBuilders:
exec "%s = _SConscript.DefaultEnvironmentCall(%s)" % (name, repr(name))
+# There are a handful of variables that used to live in the
+# Script/SConscript.py module that some SConscript files out there were
+# accessing directly as SCons.Script.SConscript.*. The problem is that
+# "SConscript" in this namespace is no longer a module, it's a global
+# function call--or more precisely, an object that implements a global
+# function call through the default Environment. Nevertheless, we can
+# aintain backwards compatibility for SConscripts that were reaching in
+# this way by hanging some attributes off the "SConscript" object here.
+SConscript = _SConscript.DefaultEnvironmentCall('SConscript')
+
+SConscript.Arguments = ARGUMENTS
+SConscript.ArgList = ARGLIST
+SConscript.BuildTargets = BUILD_TARGETS
+SConscript.CommandLineTargets = COMMAND_LINE_TARGETS
+SConscript.DefaultTargets = DEFAULT_TARGETS
+
# The global Command() function must be handled differently than the
# global functions for other construction environment methods because
# we want people to be able to use Actions that must expand $TARGET