diff options
| author | Richard Viney <richard.viney@gmail.com> | 2016-07-10 05:44:29 (GMT) |
|---|---|---|
| committer | Richard Viney <richard.viney@gmail.com> | 2016-07-10 05:44:29 (GMT) |
| commit | e011c8366fdf10a96374bf4a7695b881debf7e44 (patch) | |
| tree | e82447907f0a0980a5d051f77fd3f6a893a70291 /src/engine/SCons/Script/__init__.py | |
| parent | 2d8d535f2383db17fac0b717b76f9a6e57e9f623 (diff) | |
| parent | 1d93e3871ee6858e3bc362aa4e9822c29aadb1a3 (diff) | |
| download | SCons-e011c8366fdf10a96374bf4a7695b881debf7e44.zip SCons-e011c8366fdf10a96374bf4a7695b881debf7e44.tar.gz SCons-e011c8366fdf10a96374bf4a7695b881debf7e44.tar.bz2 | |
Merged scons/scons into default
Diffstat (limited to 'src/engine/SCons/Script/__init__.py')
| -rw-r--r-- | src/engine/SCons/Script/__init__.py | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index 90b1fc3..3fa3a48 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -41,6 +41,12 @@ start_time = time.time() import collections import os + +try: + from StringIO import StringIO +except ImportError: + from io import StringIO + import sys # Special chicken-and-egg handling of the "--debug=memoizer" flag: @@ -66,7 +72,7 @@ if "--debug=memoizer" in _args: except SCons.Warnings.Warning: # Some warning was thrown. Arrange for it to be displayed # or not after warnings are configured. - import Main + from . import Main exc_type, exc_value, tb = sys.exc_info() Main.delayed_warnings.append((exc_type, exc_value)) del _args @@ -85,7 +91,7 @@ import SCons.Util import SCons.Variables import SCons.Defaults -import Main +from . import Main main = Main.main @@ -107,6 +113,7 @@ QuestionTask = Main.QuestionTask #SConscriptSettableOptions = Main.SConscriptSettableOptions AddOption = Main.AddOption +PrintHelp = Main.PrintHelp GetOption = Main.GetOption SetOption = Main.SetOption Progress = Main.Progress @@ -128,7 +135,7 @@ GetBuildFailures = Main.GetBuildFailures #repositories = Main.repositories # -import SConscript +from . import SConscript _SConscript = SConscript call_stack = _SConscript.call_stack @@ -258,12 +265,19 @@ def _Set_Default_Targets(env, tlist): # help_text = None -def HelpFunction(text): +def HelpFunction(text, append=False): global help_text - if SCons.Script.help_text is None: - SCons.Script.help_text = text - else: - help_text = help_text + text + if help_text is None: + if append: + s = StringIO() + PrintHelp(s) + help_text = s.getvalue() + s.close() + else: + help_text = "" + + help_text= help_text + text + # # Will be non-zero if we are reading an SConscript file. @@ -345,6 +359,7 @@ GlobalDefaultBuilders = [ 'Java', 'JavaH', 'Library', + 'LoadableModule', 'M4', 'MSVSProject', 'Object', @@ -365,7 +380,7 @@ GlobalDefaultBuilders = [ ] for name in GlobalDefaultEnvironmentFunctions + GlobalDefaultBuilders: - exec "%s = _SConscript.DefaultEnvironmentCall(%s)" % (name, repr(name)) + exec ("%s = _SConscript.DefaultEnvironmentCall(%s)" % (name, repr(name))) del name # There are a handful of variables that used to live in the |
