summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xCHANGES.txt3
-rw-r--r--SCons/Action.py1
-rw-r--r--SCons/Builder.py4
-rw-r--r--SCons/BuilderTests.py1
-rw-r--r--SCons/Defaults.py1
-rw-r--r--SCons/DefaultsTests.py4
-rw-r--r--SCons/ErrorsTests.py1
-rw-r--r--SCons/Executor.py6
-rw-r--r--SCons/Node/FSTests.py1
-rw-r--r--SCons/Node/__init__.py20
-rw-r--r--SCons/PathListTests.py2
-rw-r--r--SCons/Platform/darwin.py2
-rw-r--r--SCons/Platform/posix.py3
-rw-r--r--SCons/SConf.py6
-rw-r--r--SCons/SConfTests.py2
-rw-r--r--SCons/SConsignTests.py2
-rw-r--r--SCons/Script/Main.py1
-rw-r--r--SCons/Script/MainTests.py3
-rw-r--r--SCons/Script/SConscriptTests.py2
-rw-r--r--SCons/Script/__init__.py2
-rw-r--r--SCons/Tool/GettextCommon.py92
-rw-r--r--SCons/Tool/clang.py9
-rw-r--r--SCons/Tool/clangxx.py24
-rw-r--r--SCons/Tool/f03.py25
-rw-r--r--SCons/Tool/f08.py25
-rw-r--r--SCons/Tool/f77.py25
-rw-r--r--SCons/Tool/f90.py25
-rw-r--r--SCons/Tool/f95.py25
-rw-r--r--SCons/Tool/fortran.py25
-rw-r--r--SCons/Tool/gettext_tool.py50
-rw-r--r--SCons/Tool/install.py23
-rw-r--r--SCons/Tool/intelc.py58
-rw-r--r--SCons/Tool/jar.py40
-rw-r--r--SCons/Tool/lex.py28
-rw-r--r--SCons/Tool/msgfmt.py42
-rw-r--r--SCons/Tool/msginit.py54
-rw-r--r--SCons/Tool/msgmerge.py41
-rw-r--r--SCons/Tool/msvs.py26
-rw-r--r--SCons/Tool/packaging/__init__.py17
-rw-r--r--SCons/Tool/qt.py23
-rw-r--r--SCons/Tool/swig.py26
-rw-r--r--SCons/Tool/tex.py27
-rw-r--r--SCons/Tool/xgettext.py43
-rw-r--r--SCons/Tool/yacc.py27
-rw-r--r--SCons/cpp.py4
-rw-r--r--site_scons/site_init.py6
46 files changed, 348 insertions, 529 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index e7d555d..d7765d6 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -89,6 +89,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
- Maintenance: remove obsolete __getslice__ definitions (Py3 never calls);
add Node.fs.scandir to call new (Py3.5) os.scandir; Node.fs.makedirs
now passes the exist_ok flag; Cachedir creation now uses this flag.
+ - Maintenance: remove unneeded imports and reorganize some. Fix uses
+ of warnings in some tools which instantiated the class but did nothing
+ with them, need to instead call SCons.Warnings.warn with the warn class.
From Dillan Mills:
- Add support for the (TARGET,SOURCE,TARGETS,SOURCES,CHANGED_TARGETS,CHANGED_SOURCES}.relpath property.
diff --git a/SCons/Action.py b/SCons/Action.py
index c5d3ea9..67eeb1d 100644
--- a/SCons/Action.py
+++ b/SCons/Action.py
@@ -106,7 +106,6 @@ import re
import sys
import subprocess
from subprocess import DEVNULL
-import itertools
import inspect
from collections import OrderedDict
diff --git a/SCons/Builder.py b/SCons/Builder.py
index 34bd330..38eadf8 100644
--- a/SCons/Builder.py
+++ b/SCons/Builder.py
@@ -103,12 +103,12 @@ from collections import UserDict, UserList
import SCons.Action
import SCons.Debug
-from SCons.Debug import logInstanceCreation
-from SCons.Errors import InternalError, UserError
import SCons.Executor
import SCons.Memoize
import SCons.Util
import SCons.Warnings
+from SCons.Debug import logInstanceCreation
+from SCons.Errors import InternalError, UserError
class _Null:
pass
diff --git a/SCons/BuilderTests.py b/SCons/BuilderTests.py
index 9828ef7..29b1cf0 100644
--- a/SCons/BuilderTests.py
+++ b/SCons/BuilderTests.py
@@ -38,7 +38,6 @@ import sys
import unittest
import TestCmd
-import TestUnit
import SCons.Action
import SCons.Builder
diff --git a/SCons/Defaults.py b/SCons/Defaults.py
index 50c30c6..ba42a26 100644
--- a/SCons/Defaults.py
+++ b/SCons/Defaults.py
@@ -31,7 +31,6 @@ The code that reads the registry to find MSVC components was borrowed
from distutils.msvccompiler.
"""
-import errno
import os
import shutil
import stat
diff --git a/SCons/DefaultsTests.py b/SCons/DefaultsTests.py
index 1e1ebdd..6a7ce9c 100644
--- a/SCons/DefaultsTests.py
+++ b/SCons/DefaultsTests.py
@@ -21,15 +21,11 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-import SCons.compat
-
import os
import unittest
import TestCmd
-import SCons.Errors
-
from SCons.Defaults import mkdir_func
class DefaultsTestCase(unittest.TestCase):
diff --git a/SCons/ErrorsTests.py b/SCons/ErrorsTests.py
index cc63d9b..9f2f1a2 100644
--- a/SCons/ErrorsTests.py
+++ b/SCons/ErrorsTests.py
@@ -21,7 +21,6 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-import errno
import unittest
import SCons.Errors
diff --git a/SCons/Executor.py b/SCons/Executor.py
index ee52151..492ebe3 100644
--- a/SCons/Executor.py
+++ b/SCons/Executor.py
@@ -25,12 +25,12 @@
import collections
-import SCons.Debug
-from SCons.Debug import logInstanceCreation
import SCons.Errors
import SCons.Memoize
import SCons.Util
from SCons.compat import NoSlotsPyPy
+import SCons.Debug
+from SCons.Debug import logInstanceCreation
class Batch:
"""Remembers exact association between targets
@@ -270,10 +270,8 @@ class Executor(object, metaclass=NoSlotsPyPy):
return self.get_lvars()[targets_string]
def set_action_list(self, action):
- import SCons.Util
if not SCons.Util.is_List(action):
if not action:
- import SCons.Errors
raise SCons.Errors.UserError("Executor must have an action.")
action = [action]
self.action_list = action
diff --git a/SCons/Node/FSTests.py b/SCons/Node/FSTests.py
index d2a1ebe..d78940e 100644
--- a/SCons/Node/FSTests.py
+++ b/SCons/Node/FSTests.py
@@ -31,7 +31,6 @@ import shutil
import stat
from TestCmd import TestCmd, IS_WINDOWS
-import TestUnit
import SCons.Errors
import SCons.Node.FS
diff --git a/SCons/Node/__init__.py b/SCons/Node/__init__.py
index ad177a7..b55d9e7 100644
--- a/SCons/Node/__init__.py
+++ b/SCons/Node/__init__.py
@@ -44,17 +44,11 @@ import collections
import copy
from itertools import chain, zip_longest
-import SCons.Debug
import SCons.Executor
import SCons.Memoize
-import SCons.Util
-from SCons.Util import hash_signature
-
-from SCons.Debug import Trace
-
from SCons.compat import NoSlotsPyPy
-from SCons.Debug import logInstanceCreation, Trace
-from SCons.Util import MD5signature
+from SCons.Debug import track_instances, logInstanceCreation, Trace
+from SCons.Util import hash_signature, is_List, UniqueList, render_tree
print_duplicate = 0
@@ -1278,7 +1272,7 @@ class Node(object, metaclass=NoSlotsPyPy):
self._add_child(self.depends, self.depends_set, depend)
except TypeError as e:
e = e.args[0]
- if SCons.Util.is_List(e):
+ if is_List(e):
s = list(map(str, e))
else:
s = str(e)
@@ -1287,7 +1281,7 @@ class Node(object, metaclass=NoSlotsPyPy):
def add_prerequisite(self, prerequisite):
"""Adds prerequisites"""
if self.prerequisites is None:
- self.prerequisites = SCons.Util.UniqueList()
+ self.prerequisites = UniqueList()
self.prerequisites.extend(prerequisite)
self._children_reset()
@@ -1297,7 +1291,7 @@ class Node(object, metaclass=NoSlotsPyPy):
self._add_child(self.ignore, self.ignore_set, depend)
except TypeError as e:
e = e.args[0]
- if SCons.Util.is_List(e):
+ if is_List(e):
s = list(map(str, e))
else:
s = str(e)
@@ -1311,7 +1305,7 @@ class Node(object, metaclass=NoSlotsPyPy):
self._add_child(self.sources, self.sources_set, source)
except TypeError as e:
e = e.args[0]
- if SCons.Util.is_List(e):
+ if is_List(e):
s = list(map(str, e))
else:
s = str(e)
@@ -1555,7 +1549,7 @@ class Node(object, metaclass=NoSlotsPyPy):
path = None
def f(node, env=env, scanner=scanner, path=path):
return node.get_found_includes(env, scanner, path)
- return SCons.Util.render_tree(s, f, 1)
+ return render_tree(s, f, 1)
else:
return None
diff --git a/SCons/PathListTests.py b/SCons/PathListTests.py
index ea7cecd..e62baad 100644
--- a/SCons/PathListTests.py
+++ b/SCons/PathListTests.py
@@ -23,8 +23,6 @@
import unittest
-import TestUnit
-
import SCons.PathList
diff --git a/SCons/Platform/darwin.py b/SCons/Platform/darwin.py
index 68cb7df..d9d7f2d 100644
--- a/SCons/Platform/darwin.py
+++ b/SCons/Platform/darwin.py
@@ -44,7 +44,7 @@ def generate(env):
# make sure this works on Macs with Tiger or earlier
try:
dirlist = os.listdir('/etc/paths.d')
- except:
+ except FileNotFoundError:
dirlist = []
for file in dirlist:
diff --git a/SCons/Platform/posix.py b/SCons/Platform/posix.py
index 4c9f8f9..dc98408 100644
--- a/SCons/Platform/posix.py
+++ b/SCons/Platform/posix.py
@@ -28,11 +28,8 @@ will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
-import errno
import subprocess
-import select
-import SCons.Util
from SCons.Platform import TempFileMunge
from SCons.Platform.virtualenv import ImportVirtualenv
from SCons.Platform.virtualenv import ignore_virtualenv, enable_virtualenv
diff --git a/SCons/SConf.py b/SCons/SConf.py
index d024600..68e890a 100644
--- a/SCons/SConf.py
+++ b/SCons/SConf.py
@@ -234,8 +234,10 @@ class SConfBuildTask(SCons.Taskmaster.AlwaysTask):
bi.
"""
if not isinstance(bi, SConfBuildInfo):
- SCons.Warnings.warn(SConfWarning,
- "The stored build information has an unexpected class: %s" % bi.__class__)
+ SCons.Warnings.warn(
+ SConfWarning,
+ "The stored build information has an unexpected class: %s" % bi.__class__
+ )
else:
self.display("The original builder output was:\n" +
(" |" + str(bi.string)).replace("\n", "\n |"))
diff --git a/SCons/SConfTests.py b/SCons/SConfTests.py
index a6fe508..008dfc2 100644
--- a/SCons/SConfTests.py
+++ b/SCons/SConfTests.py
@@ -21,8 +21,6 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-import SCons.compat
-
import io
import os
import re
diff --git a/SCons/SConsignTests.py b/SCons/SConsignTests.py
index fdce588..d4f4418 100644
--- a/SCons/SConsignTests.py
+++ b/SCons/SConsignTests.py
@@ -25,10 +25,8 @@ import os
import unittest
import TestCmd
-import TestUnit
import SCons.dblite
-
import SCons.SConsign
class BuildInfo:
diff --git a/SCons/Script/Main.py b/SCons/Script/Main.py
index 15f7ece..b674692 100644
--- a/SCons/Script/Main.py
+++ b/SCons/Script/Main.py
@@ -44,7 +44,6 @@ import re
import sys
import time
import traceback
-import sysconfig
import platform
import threading
diff --git a/SCons/Script/MainTests.py b/SCons/Script/MainTests.py
index 232a8a2..f7e3263 100644
--- a/SCons/Script/MainTests.py
+++ b/SCons/Script/MainTests.py
@@ -23,9 +23,6 @@
import unittest
-import SCons.Errors
-import SCons.Script.Main
-
# Unit tests of various classes within SCons.Script.Main.py.
#
# Most of the tests of this functionality are actually end-to-end scripts
diff --git a/SCons/Script/SConscriptTests.py b/SCons/Script/SConscriptTests.py
index bb88dfa..e6a8be5 100644
--- a/SCons/Script/SConscriptTests.py
+++ b/SCons/Script/SConscriptTests.py
@@ -21,8 +21,6 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-import SCons.Script.SConscript
-
# all of the SConscript.py tests are in test/SConscript.py
# Local Variables:
diff --git a/SCons/Script/__init__.py b/SCons/Script/__init__.py
index dff1567..5f58d99 100644
--- a/SCons/Script/__init__.py
+++ b/SCons/Script/__init__.py
@@ -255,7 +255,7 @@ def HelpFunction(text, append=False):
if help_text is None:
if append:
s = StringIO()
- PrintHelp(s)
+ PrintHelp(s)
help_text = s.getvalue()
s.close()
else:
diff --git a/SCons/Tool/GettextCommon.py b/SCons/Tool/GettextCommon.py
index 5da4517..16900e0 100644
--- a/SCons/Tool/GettextCommon.py
+++ b/SCons/Tool/GettextCommon.py
@@ -1,9 +1,6 @@
-"""SCons.Tool.GettextCommon module
-
-Used by several tools of `gettext` toolset.
-"""
-
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -24,38 +21,49 @@ Used by several tools of `gettext` toolset.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""Common routines for gettext tools
-import SCons.Warnings
+Used by several tools of `gettext` toolset.
+"""
+
+import os
import re
+import SCons.Util
+import SCons.Warnings
-#############################################################################
-class XgettextToolWarning(SCons.Warnings.SConsWarning): pass
+class XgettextToolWarning(SCons.Warnings.SConsWarning):
+ pass
-class XgettextNotFound(XgettextToolWarning): pass
+class XgettextNotFound(XgettextToolWarning):
+ pass
-class MsginitToolWarning(SCons.Warnings.SConsWarning): pass
+class MsginitToolWarning(SCons.Warnings.SConsWarning):
+ pass
-class MsginitNotFound(MsginitToolWarning): pass
+class MsginitNotFound(MsginitToolWarning):
+ pass
-class MsgmergeToolWarning(SCons.Warnings.SConsWarning): pass
+class MsgmergeToolWarning(SCons.Warnings.SConsWarning):
+ pass
-class MsgmergeNotFound(MsgmergeToolWarning): pass
+class MsgmergeNotFound(MsgmergeToolWarning):
+ pass
-class MsgfmtToolWarning(SCons.Warnings.SConsWarning): pass
+class MsgfmtToolWarning(SCons.Warnings.SConsWarning):
+ pass
-class MsgfmtNotFound(MsgfmtToolWarning): pass
+class MsgfmtNotFound(MsgfmtToolWarning):
+ pass
-#############################################################################
SCons.Warnings.enableWarningClass(XgettextToolWarning)
SCons.Warnings.enableWarningClass(XgettextNotFound)
SCons.Warnings.enableWarningClass(MsginitToolWarning)
@@ -66,9 +74,6 @@ SCons.Warnings.enableWarningClass(MsgfmtToolWarning)
SCons.Warnings.enableWarningClass(MsgfmtNotFound)
-#############################################################################
-
-#############################################################################
class _POTargetFactory:
""" A factory of `PO` target files.
@@ -101,7 +106,6 @@ class _POTargetFactory:
def _create_node(self, name, factory, directory=None, create=1):
""" Create node, and set it up to factory settings. """
- import SCons.Util
node = factory(name, directory, create)
node.set_noclean(self.noclean)
node.set_precious(self.precious)
@@ -120,18 +124,12 @@ class _POTargetFactory:
return self._create_node(name, self.env.fs.File, directory, create)
-#############################################################################
-
-#############################################################################
_re_comment = re.compile(r'(#[^\n\r]+)$', re.M)
_re_lang = re.compile(r'([a-zA-Z0-9_]+)', re.M)
-#############################################################################
def _read_linguas_from_files(env, linguas_files=None):
""" Parse `LINGUAS` file and return list of extracted languages """
- import SCons.Util
- import SCons.Environment
global _re_comment
global _re_lang
if not SCons.Util.is_List(linguas_files) \
@@ -151,13 +149,9 @@ def _read_linguas_from_files(env, linguas_files=None):
return linguas
-#############################################################################
-
-#############################################################################
from SCons.Builder import BuilderBase
-#############################################################################
class _POFileBuilder(BuilderBase):
""" `PO` file builder.
@@ -222,7 +216,6 @@ class _POFileBuilder(BuilderBase):
The arguments and return value are same as for
`SCons.Builder.BuilderBase._execute()`.
"""
- import SCons.Util
import SCons.Node
linguas_files = None
if 'LINGUAS_FILE' in env and env['LINGUAS_FILE']:
@@ -252,12 +245,6 @@ class _POFileBuilder(BuilderBase):
return SCons.Node.NodeList(result)
-#############################################################################
-
-import SCons.Environment
-
-
-#############################################################################
def _translate(env, target=None, source=SCons.Environment._null, *args, **kw):
""" Function for `Translate()` pseudo-builder """
if target is None: target = []
@@ -266,9 +253,6 @@ def _translate(env, target=None, source=SCons.Environment._null, *args, **kw):
return po
-#############################################################################
-
-#############################################################################
class RPaths:
""" Callable object, which returns pathnames relative to SCons current
working directory.
@@ -342,7 +326,6 @@ class RPaths:
- Tuple of strings, which represent paths relative to current working
directory (for given environment).
"""
- import os
import SCons.Node.FS
rpaths = ()
cwd = self.env.fs.getcwd().get_abspath()
@@ -356,9 +339,6 @@ class RPaths:
return rpaths
-#############################################################################
-
-#############################################################################
def _init_po_files(target, source, env):
""" Action function for `POInit` builder. """
nop = lambda target, source, env: 0
@@ -383,9 +363,6 @@ def _init_po_files(target, source, env):
return 0
-#############################################################################
-
-#############################################################################
def _detect_xgettext(env):
""" Detects *xgettext(1)* binary """
if 'XGETTEXT' in env:
@@ -397,14 +374,10 @@ def _detect_xgettext(env):
return None
-#############################################################################
def _xgettext_exists(env):
return _detect_xgettext(env)
-#############################################################################
-
-#############################################################################
def _detect_msginit(env):
""" Detects *msginit(1)* program. """
if 'MSGINIT' in env:
@@ -416,14 +389,10 @@ def _detect_msginit(env):
return None
-#############################################################################
def _msginit_exists(env):
return _detect_msginit(env)
-#############################################################################
-
-#############################################################################
def _detect_msgmerge(env):
""" Detects *msgmerge(1)* program. """
if 'MSGMERGE' in env:
@@ -435,14 +404,10 @@ def _detect_msgmerge(env):
return None
-#############################################################################
def _msgmerge_exists(env):
return _detect_msgmerge(env)
-#############################################################################
-
-#############################################################################
def _detect_msgfmt(env):
""" Detects *msgmfmt(1)* program. """
if 'MSGFMT' in env:
@@ -454,16 +419,11 @@ def _detect_msgfmt(env):
return None
-#############################################################################
def _msgfmt_exists(env):
return _detect_msgfmt(env)
-#############################################################################
-
-#############################################################################
def tool_list(platform, env):
""" List tools that shall be generated by top-level `gettext` tool """
return ['xgettext', 'msginit', 'msgmerge', 'msgfmt']
-#############################################################################
diff --git a/SCons/Tool/clang.py b/SCons/Tool/clang.py
index e033cfa..6c9227c 100644
--- a/SCons/Tool/clang.py
+++ b/SCons/Tool/clang.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8; -*-
-#
# MIT License
#
# Copyright The SCons Foundation
@@ -22,25 +20,20 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-"""SCons.Tool.clang
-Tool-specific initialization for clang.
+"""Tool-specific initialization for clang.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
-
"""
-
# Based on SCons/Tool/gcc.py by Paweł Tomulik 2014 as a separate tool.
# Brought into the SCons mainline by Russel Winder 2017.
import os
import re
import subprocess
-import sys
import SCons.Util
import SCons.Tool.cc
diff --git a/SCons/Tool/clangxx.py b/SCons/Tool/clangxx.py
index 736d455..4443b39 100644
--- a/SCons/Tool/clangxx.py
+++ b/SCons/Tool/clangxx.py
@@ -1,17 +1,6 @@
-# -*- coding: utf-8; -*-
-
-"""SCons.Tool.clang++
-
-Tool-specific initialization for clang++.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,9 +20,13 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""Tool-specific initialization for clang++.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+"""
# Based on SCons/Tool/g++.py by Paweł Tomulik 2014 as a separate tool.
# Brought into the SCons mainline by Russel Winder 2017.
@@ -41,7 +34,6 @@ selection method.
import os.path
import re
import subprocess
-import sys
import SCons.Tool
import SCons.Util
diff --git a/SCons/Tool/f03.py b/SCons/Tool/f03.py
index 41d9c43..142c127 100644
--- a/SCons/Tool/f03.py
+++ b/SCons/Tool/f03.py
@@ -1,15 +1,6 @@
-"""SCons.Tool.f03
-
-Tool-specific initialization for the generic Posix f03 Fortran compiler.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -29,14 +20,14 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""Tool-specific initialization for the generic Posix f03 Fortran compiler.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+"""
-import SCons.Defaults
-import SCons.Tool
-import SCons.Util
-from . import fortran
from SCons.Tool.FortranCommon import add_all_to_env, add_f03_to_env
compilers = ['f03']
diff --git a/SCons/Tool/f08.py b/SCons/Tool/f08.py
index 3d1bce2..eb367c5 100644
--- a/SCons/Tool/f08.py
+++ b/SCons/Tool/f08.py
@@ -1,15 +1,6 @@
-"""SCons.Tool.f08
-
-Tool-specific initialization for the generic Posix f08 Fortran compiler.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -29,14 +20,14 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""Tool-specific initialization for the generic Posix f08 Fortran compiler.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+"""
-import SCons.Defaults
-import SCons.Tool
-import SCons.Util
-from . import fortran
from SCons.Tool.FortranCommon import add_all_to_env, add_f08_to_env
compilers = ['f08']
diff --git a/SCons/Tool/f77.py b/SCons/Tool/f77.py
index b936acd..5ff15ae 100644
--- a/SCons/Tool/f77.py
+++ b/SCons/Tool/f77.py
@@ -1,15 +1,6 @@
-"""SCons.Tool.f77
-
-Tool-specific initialization for the generic Posix f77 Fortran compiler.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -29,14 +20,14 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""Tool-specific initialization for the generic Posix f77 Fortran compiler.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+"""
-import SCons.Defaults
-import SCons.Scanner.Fortran
-import SCons.Tool
-import SCons.Util
from SCons.Tool.FortranCommon import add_all_to_env, add_f77_to_env
compilers = ['f77']
diff --git a/SCons/Tool/f90.py b/SCons/Tool/f90.py
index ef7d93d..cbf3947 100644
--- a/SCons/Tool/f90.py
+++ b/SCons/Tool/f90.py
@@ -1,15 +1,6 @@
-"""SCons.Tool.f90
-
-Tool-specific initialization for the generic Posix f90 Fortran compiler.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -29,14 +20,14 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""Tool-specific initialization for the generic Posix f90 Fortran compiler.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+"""
-import SCons.Defaults
-import SCons.Scanner.Fortran
-import SCons.Tool
-import SCons.Util
from SCons.Tool.FortranCommon import add_all_to_env, add_f90_to_env
compilers = ['f90']
diff --git a/SCons/Tool/f95.py b/SCons/Tool/f95.py
index 7b56d4e..4830ee0 100644
--- a/SCons/Tool/f95.py
+++ b/SCons/Tool/f95.py
@@ -1,15 +1,6 @@
-"""SCons.Tool.f95
-
-Tool-specific initialization for the generic Posix f95 Fortran compiler.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -29,14 +20,14 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""Tool-specific initialization for the generic Posix f95 Fortran compiler.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+"""
-import SCons.Defaults
-import SCons.Tool
-import SCons.Util
-from . import fortran
from SCons.Tool.FortranCommon import add_all_to_env, add_f95_to_env
compilers = ['f95']
diff --git a/SCons/Tool/fortran.py b/SCons/Tool/fortran.py
index 0a68df6..9a095ae 100644
--- a/SCons/Tool/fortran.py
+++ b/SCons/Tool/fortran.py
@@ -1,15 +1,6 @@
-"""SCons.Tool.fortran
-
-Tool-specific initialization for a generic Posix f77/f90 Fortran compiler.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -29,16 +20,14 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""Tool-specific initialization for a generic Posix f77/f90 Fortran compiler.
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+"""
-import SCons.Action
-import SCons.Defaults
-import SCons.Scanner.Fortran
-import SCons.Tool
-import SCons.Util
from SCons.Tool.FortranCommon import add_all_to_env, add_fortran_to_env
compilers = ['f95', 'f90', 'f77']
diff --git a/SCons/Tool/gettext_tool.py b/SCons/Tool/gettext_tool.py
index 43ca494..8e66a56 100644
--- a/SCons/Tool/gettext_tool.py
+++ b/SCons/Tool/gettext_tool.py
@@ -1,9 +1,7 @@
-"""gettext tool
-"""
-
-
-# __COPYRIGHT__
-#
+# MIT License
+#
+# Copyright The SCons Foundation
+#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
@@ -11,10 +9,10 @@
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
-#
+#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
-#
+#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -23,13 +21,13 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""gettext tool"""
-#############################################################################
def generate(env,**kw):
import sys
import os
import SCons.Tool
+ import SCons.Warnings
from SCons.Platform.mingw import MINGW_DEFAULT_PATHS
from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS
@@ -42,19 +40,27 @@ def generate(env,**kw):
tool_bin_dir = os.path.dirname(tool)
env.AppendENVPath('PATH', tool_bin_dir)
else:
- SCons.Warnings.SConsWarning(t + ' tool requested, but binary not found in ENV PATH')
+ SCons.Warnings.warn(
+ SCons.Warnings.SConsWarning,
+ t + ' tool requested, but binary not found in ENV PATH'
+ )
env.Tool(t)
env.AddMethod(_translate, 'Translate')
-#############################################################################
-#############################################################################
def exists(env):
- from SCons.Tool.GettextCommon \
- import _xgettext_exists, _msginit_exists, \
- _msgmerge_exists, _msgfmt_exists
- try:
- return _xgettext_exists(env) and _msginit_exists(env) \
- and _msgmerge_exists(env) and _msgfmt_exists(env)
- except:
- return False
-#############################################################################
+ from SCons.Tool.GettextCommon import (
+ _xgettext_exists,
+ _msginit_exists,
+ _msgmerge_exists,
+ _msgfmt_exists,
+ )
+
+ try:
+ return (
+ _xgettext_exists(env)
+ and _msginit_exists(env)
+ and _msgmerge_exists(env)
+ and _msgfmt_exists(env)
+ )
+ except:
+ return False
diff --git a/SCons/Tool/install.py b/SCons/Tool/install.py
index 9910264..59b4a52 100644
--- a/SCons/Tool/install.py
+++ b/SCons/Tool/install.py
@@ -1,14 +1,6 @@
-"""SCons.Tool.install
-
-Tool-specific initialization for the install tool.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-"""
-
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -28,11 +20,17 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
+
+""" Tool-specific initialization for the install tool.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+"""
import os
import stat
-from shutil import copy2, copymode, copystat
+from shutil import copy2, copystat
import SCons.Action
import SCons.Tool
@@ -44,7 +42,6 @@ from SCons.Tool.linkCommon import (
EmitLibSymlinks,
)
-#
# We keep track of *all* installed files.
_INSTALLED_FILES = []
_UNIQUE_INSTALLED_FILES = None
diff --git a/SCons/Tool/intelc.py b/SCons/Tool/intelc.py
index 5025719..50011b1 100644
--- a/SCons/Tool/intelc.py
+++ b/SCons/Tool/intelc.py
@@ -1,16 +1,6 @@
-"""SCons.Tool.icl
-
-Tool-specific initialization for the Intel C/C++ compiler.
-Supports Linux and Windows compilers, v7 and up.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,7 +20,15 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""Tool-specific initialization for the Intel C/C++ compiler.
+
+Supports Linux and Windows compilers, v7 and up.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+"""
import glob
import math
@@ -454,20 +452,25 @@ def generate(env, version=None, abi=None, topdir=None, verbose=0):
# on $PATH and the user is importing their env.
class ICLTopDirWarning(SCons.Warnings.SConsWarning):
pass
- if (is_mac or is_linux) and not env.Detect('icc') or \
- is_windows and not env.Detect('icl'):
+
+ if (is_mac or is_linux) and not env.Detect('icc') \
+ or is_windows and not env.Detect('icl'):
SCons.Warnings.enableWarningClass(ICLTopDirWarning)
- SCons.Warnings.warn(ICLTopDirWarning,
- "Failed to find Intel compiler for version='%s', abi='%s'"%
- (str(version), str(abi)))
+ SCons.Warnings.warn(
+ ICLTopDirWarning,
+ "Failed to find Intel compiler for version='%s', abi='%s'"
+ % (str(version), str(abi)),
+ )
else:
# should be cleaned up to say what this other version is
# since in this case we have some other Intel compiler installed
SCons.Warnings.enableWarningClass(ICLTopDirWarning)
- SCons.Warnings.warn(ICLTopDirWarning,
- "Can't find Intel compiler top dir for version='%s', abi='%s'"%
- (str(version), str(abi)))
+ SCons.Warnings.warn(
+ ICLTopDirWarning,
+ "Can't find Intel compiler top dir for version='%s', abi='%s'"
+ % (str(version), str(abi)),
+ )
if topdir:
archdir={'x86_64': 'intel64',
@@ -576,11 +579,14 @@ def generate(env, version=None, abi=None, topdir=None, verbose=0):
class ICLLicenseDirWarning(SCons.Warnings.SConsWarning):
pass
SCons.Warnings.enableWarningClass(ICLLicenseDirWarning)
- SCons.Warnings.warn(ICLLicenseDirWarning,
- "Intel license dir was not found."
- " Tried using the INTEL_LICENSE_FILE environment variable (%s), the registry (%s) and the default path (%s)."
- " Using the default path as a last resort."
- % (envlicdir, reglicdir, defaultlicdir))
+ SCons.Warnings.warn(
+ ICLLicenseDirWarning,
+ "Intel license dir was not found. "
+ "Tried using the INTEL_LICENSE_FILE environment variable "
+ "(%s), the registry (%s) and the default path (%s). "
+ "Using the default path as a last resort."
+ % (envlicdir, reglicdir, defaultlicdir)
+ )
env['ENV']['INTEL_LICENSE_FILE'] = licdir
def exists(env):
diff --git a/SCons/Tool/jar.py b/SCons/Tool/jar.py
index fa29987..a19c40a 100644
--- a/SCons/Tool/jar.py
+++ b/SCons/Tool/jar.py
@@ -1,15 +1,6 @@
-"""SCons.Tool.jar
-
-Tool-specific initialization for jar.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -29,13 +20,19 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""Tool-specific initialization for jar.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+"""
+
import os
import SCons.Subst
import SCons.Util
+import SCons.Warnings
from SCons.Node.FS import _my_normcase
from SCons.Tool.JavaCommon import get_java_install_dirs
@@ -101,8 +98,10 @@ def Jar(env, target = None, source = [], *args, **kw):
# no target and want implicit target to be made and the arg
# was actaully the list of sources
if SCons.Util.is_List(target) and source == []:
- SCons.Warnings.SConsWarning("Making implicit target jar file, " +
- "and treating the list as sources")
+ SCons.Warnings.warn(
+ SCons.Warnings.SConsWarning,
+ "Making implicit target jar file, and treating the list as sources"
+ )
source = target
target = None
@@ -123,7 +122,10 @@ def Jar(env, target = None, source = [], *args, **kw):
target = os.path.splitext(str(source[0]))[0] + env.subst('$JARSUFFIX')
except:
# something strange is happening but attempt anyways
- SCons.Warnings.SConsWarning("Could not make implicit target from sources, using directory")
+ SCons.Warnings.warn(
+ SCons.Warnings.SConsWarning,
+ "Could not make implicit target from sources, using directory"
+ )
target = os.path.basename(str(env.Dir('.'))) + env.subst('$JARSUFFIX')
# make lists out of our target and sources
@@ -192,7 +194,11 @@ def Jar(env, target = None, source = [], *args, **kw):
except:
pass
- SCons.Warnings.SConsWarning("File: " + str(s) + " could not be identified as File or Directory, skipping.")
+ SCons.Warnings.warn(
+ SCons.Warnings.SConsWarning,
+ ("File: " + str(s)
+ + " could not be identified as File or Directory, skipping.")
+ )
# at this point all our sources have been converted to classes or directories of class
# so pass it to the Jar builder
diff --git a/SCons/Tool/lex.py b/SCons/Tool/lex.py
index a9f7a8a..d8d8de4 100644
--- a/SCons/Tool/lex.py
+++ b/SCons/Tool/lex.py
@@ -1,15 +1,6 @@
-"""SCons.Tool.lex
-
-Tool-specific initialization for lex.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -29,9 +20,13 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""Tool-specific initialization for lex.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+"""
import os.path
import sys
@@ -39,6 +34,7 @@ import sys
import SCons.Action
import SCons.Tool
import SCons.Util
+import SCons.Warnings
from SCons.Platform.mingw import MINGW_DEFAULT_PATHS
from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS
from SCons.Platform.win32 import CHOCO_DEFAULT_PATH
@@ -93,7 +89,11 @@ def get_lex_path(env, append_paths=False):
if append_paths:
env.AppendENVPath('PATH', os.path.dirname(bin_path))
return bin_path
- SCons.Warnings.SConsWarning('lex tool requested, but lex or flex binary not found in ENV PATH')
+
+ SCons.Warnings.warn(
+ SCons.Warnings.SConsWarning,
+ 'lex tool requested, but lex or flex binary not found in ENV PATH'
+ )
def generate(env):
diff --git a/SCons/Tool/msgfmt.py b/SCons/Tool/msgfmt.py
index 3a77fc6..873e66b 100644
--- a/SCons/Tool/msgfmt.py
+++ b/SCons/Tool/msgfmt.py
@@ -1,7 +1,7 @@
-""" msgfmt tool """
-
-# __COPYRIGHT__
-#
+# MIT License
+#
+# Copyright The SCons Foundation
+#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
@@ -9,10 +9,10 @@
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
-#
+#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
-#
+#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -21,14 +21,14 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+""" msgfmt tool """
from SCons.Builder import BuilderBase
-#############################################################################
+
class _MOFileBuilder(BuilderBase):
""" The builder class for `MO` files.
-
- The reason for this builder to exists and its purpose is quite simillar
+
+ The reason for this builder to exists and its purpose is quite simillar
as for `_POFileBuilder`. This time, we extend list of sources, not targets,
and call `BuilderBase._execute()` only once (as we assume single-target
here).
@@ -43,7 +43,7 @@ class _MOFileBuilder(BuilderBase):
linguas_files = None
if 'LINGUAS_FILE' in env and env['LINGUAS_FILE'] is not None:
linguas_files = env['LINGUAS_FILE']
- # This should prevent from endless recursion.
+ # This should prevent from endless recursion.
env['LINGUAS_FILE'] = None
# We read only languages. Suffixes shall be added automatically.
linguas = _read_linguas_from_files(env, linguas_files)
@@ -57,9 +57,8 @@ class _MOFileBuilder(BuilderBase):
if linguas_files is not None:
env['LINGUAS_FILE'] = linguas_files
return result
-#############################################################################
-#############################################################################
+
def _create_mo_file_builder(env, **kw):
""" Create builder object for `MOFiles` builder """
import SCons.Action
@@ -68,17 +67,17 @@ def _create_mo_file_builder(env, **kw):
kw['suffix'] = '$MOSUFFIX'
kw['src_suffix'] = '$POSUFFIX'
kw['src_builder'] = '_POUpdateBuilder'
- kw['single_source'] = True
+ kw['single_source'] = True
return _MOFileBuilder(**kw)
-#############################################################################
-#############################################################################
+
def generate(env,**kw):
""" Generate `msgfmt` tool """
import sys
import os
- import SCons.Util
import SCons.Tool
+ import SCons.Util
+ import SCons.Warnings
from SCons.Tool.GettextCommon import _detect_msgfmt
from SCons.Platform.mingw import MINGW_DEFAULT_PATHS
from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS
@@ -89,7 +88,10 @@ def generate(env,**kw):
msgfmt_bin_dir = os.path.dirname(msgfmt)
env.AppendENVPath('PATH', msgfmt_bin_dir)
else:
- SCons.Warnings.SConsWarning('msgfmt tool requested, but binary not found in ENV PATH')
+ SCons.Warnings.warn(
+ SCons.Warnings.SConsWarning,
+ 'msgfmt tool requested, but binary not found in ENV PATH'
+ )
try:
env['MSGFMT'] = _detect_msgfmt(env)
@@ -103,9 +105,8 @@ def generate(env,**kw):
POSUFFIX = ['.po']
)
env.Append( BUILDERS = { 'MOFiles' : _create_mo_file_builder(env) } )
-#############################################################################
-#############################################################################
+
def exists(env):
""" Check if the tool exists """
from SCons.Tool.GettextCommon import _msgfmt_exists
@@ -113,7 +114,6 @@ def exists(env):
return _msgfmt_exists(env)
except:
return False
-#############################################################################
# Local Variables:
# tab-width:4
diff --git a/SCons/Tool/msginit.py b/SCons/Tool/msginit.py
index 4b72c30..b099686 100644
--- a/SCons/Tool/msginit.py
+++ b/SCons/Tool/msginit.py
@@ -1,10 +1,7 @@
-""" msginit tool
-
-Tool specific initialization of msginit tool.
-"""
-
-# __COPYRIGHT__
-#
+# MIT License
+#
+# Copyright The SCons Foundation
+#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
@@ -12,10 +9,10 @@ Tool specific initialization of msginit tool.
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
-#
+#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
-#
+#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -24,16 +21,16 @@ Tool specific initialization of msginit tool.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""Tool specific initialization of msginit tool."""
+import SCons.Action
+import SCons.Util
import SCons.Warnings
-import SCons.Builder
+from SCons.Environment import _null
-#############################################################################
def _optional_no_translator_flag(env):
""" Return '--no-translator' flag if we run *msginit(1)* in non-interactive
mode."""
- import SCons.Util
if 'POAUTOINIT' in env:
autoinit = env['POAUTOINIT']
else:
@@ -42,25 +39,20 @@ def _optional_no_translator_flag(env):
return [SCons.Util.CLVar('--no-translator')]
else:
return [SCons.Util.CLVar('')]
-#############################################################################
-#############################################################################
+
def _POInitBuilder(env, **kw):
""" Create builder object for `POInit` builder. """
- import SCons.Action
from SCons.Tool.GettextCommon import _init_po_files, _POFileBuilder
action = SCons.Action.Action(_init_po_files, None)
return _POFileBuilder(env, action=action, target_alias='$POCREATE_ALIAS')
-#############################################################################
-
-#############################################################################
-from SCons.Environment import _null
-#############################################################################
+
+
def _POInitBuilderWrapper(env, target=None, source=_null, **kw):
""" Wrapper for _POFileBuilder. We use it to make user's life easier.
-
+
This wrapper checks for `$POTDOMAIN` construction variable (or override in
- `**kw`) and treats it appropriatelly.
+ `**kw`) and treats it appropriatelly.
"""
if source is _null:
if 'POTDOMAIN' in kw:
@@ -69,17 +61,16 @@ def _POInitBuilderWrapper(env, target=None, source=_null, **kw):
domain = env['POTDOMAIN']
else:
domain = 'messages'
- source = [ domain ] # NOTE: Suffix shall be appended automatically
+ source = [ domain ] # NOTE: Suffix shall be appended automatically
return env._POInitBuilder(target, source, **kw)
-#############################################################################
-#############################################################################
+
def generate(env,**kw):
""" Generate the `msginit` tool """
import sys
import os
- import SCons.Util
import SCons.Tool
+ import SCons.Warnings
from SCons.Tool.GettextCommon import _detect_msginit
from SCons.Platform.mingw import MINGW_DEFAULT_PATHS
from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS
@@ -90,7 +81,10 @@ def generate(env,**kw):
msginit_bin_dir = os.path.dirname(msginit)
env.AppendENVPath('PATH', msginit_bin_dir)
else:
- SCons.Warnings.SConsWarning('msginit tool requested, but binary not found in ENV PATH')
+ SCons.Warnings.warn(
+ SCons.Warnings.SConsWarning,
+ 'msginit tool requested, but binary not found in ENV PATH'
+ )
try:
env['MSGINIT'] = _detect_msginit(env)
@@ -114,9 +108,8 @@ def generate(env,**kw):
env.Append( BUILDERS = { '_POInitBuilder' : _POInitBuilder(env) } )
env.AddMethod(_POInitBuilderWrapper, 'POInit')
env.AlwaysBuild(env.Alias('$POCREATE_ALIAS'))
-#############################################################################
-#############################################################################
+
def exists(env):
""" Check if the tool exists """
from SCons.Tool.GettextCommon import _msginit_exists
@@ -124,7 +117,6 @@ def exists(env):
return _msginit_exists(env)
except:
return False
-#############################################################################
# Local Variables:
# tab-width:4
diff --git a/SCons/Tool/msgmerge.py b/SCons/Tool/msgmerge.py
index 4551235..f30b27d 100644
--- a/SCons/Tool/msgmerge.py
+++ b/SCons/Tool/msgmerge.py
@@ -1,10 +1,7 @@
-""" msgmerget tool
-
-Tool specific initialization for `msgmerge` tool.
-"""
-
-# __COPYRIGHT__
-#
+# MIT License
+#
+# Copyright The SCons Foundation
+#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
@@ -12,10 +9,10 @@ Tool specific initialization for `msgmerge` tool.
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
-#
+#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
-#
+#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -24,9 +21,8 @@ Tool specific initialization for `msgmerge` tool.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""Tool specific initialization for `msgmerge` tool."""
-#############################################################################
def _update_or_init_po_files(target, source, env):
""" Action function for `POUpdate` builder """
import SCons.Action
@@ -39,20 +35,18 @@ def _update_or_init_po_files(target, source, env):
status = action([tgt], source, env)
if status : return status
return 0
-#############################################################################
-#############################################################################
+
def _POUpdateBuilder(env, **kw):
""" Create an object of `POUpdate` builder """
import SCons.Action
from SCons.Tool.GettextCommon import _POFileBuilder
action = SCons.Action.Action(_update_or_init_po_files, None)
return _POFileBuilder(env, action=action, target_alias='$POUPDATE_ALIAS')
-#############################################################################
-#############################################################################
+
from SCons.Environment import _null
-#############################################################################
+
def _POUpdateBuilderWrapper(env, target=None, source=_null, **kw):
""" Wrapper for `POUpdate` builder - make user's life easier """
if source is _null:
@@ -62,16 +56,16 @@ def _POUpdateBuilderWrapper(env, target=None, source=_null, **kw):
domain = env['POTDOMAIN']
else:
domain = 'messages'
- source = [ domain ] # NOTE: Suffix shall be appended automatically
+ source = [ domain ] # NOTE: Suffix shall be appended automatically
return env._POUpdateBuilder(target, source, **kw)
-#############################################################################
-#############################################################################
+
def generate(env,**kw):
""" Generate the `msgmerge` tool """
import sys
import os
import SCons.Tool
+ import SCons.Warnings
from SCons.Tool.GettextCommon import _detect_msgmerge
from SCons.Platform.mingw import MINGW_DEFAULT_PATHS
from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS
@@ -82,7 +76,10 @@ def generate(env,**kw):
msgmerge_bin_dir = os.path.dirname(msgmerge)
env.AppendENVPath('PATH', msgmerge_bin_dir)
else:
- SCons.Warnings.SConsWarning('msgmerge tool requested, but binary not found in ENV PATH')
+ SCons.Warnings.warn(
+ SCons.Warnings.SConsWarning,
+ 'msgmerge tool requested, but binary not found in ENV PATH'
+ )
try:
env['MSGMERGE'] = _detect_msgmerge(env)
except:
@@ -98,9 +95,8 @@ def generate(env,**kw):
env.Append(BUILDERS = { '_POUpdateBuilder':_POUpdateBuilder(env) })
env.AddMethod(_POUpdateBuilderWrapper, 'POUpdate')
env.AlwaysBuild(env.Alias('$POUPDATE_ALIAS'))
-#############################################################################
-#############################################################################
+
def exists(env):
""" Check if the tool exists """
from SCons.Tool.GettextCommon import _msgmerge_exists
@@ -108,7 +104,6 @@ def exists(env):
return _msgmerge_exists(env)
except:
return False
-#############################################################################
# Local Variables:
# tab-width:4
diff --git a/SCons/Tool/msvs.py b/SCons/Tool/msvs.py
index c398365..9fdee65 100644
--- a/SCons/Tool/msvs.py
+++ b/SCons/Tool/msvs.py
@@ -1,15 +1,6 @@
-"""SCons.Tool.msvs
-
-Tool-specific initialization for Microsoft Visual Studio project files.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -29,9 +20,13 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import SCons.compat
+""" Tool-specific initialization for Microsoft Visual Studio project files.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+"""
import base64
import uuid
@@ -48,10 +43,9 @@ import SCons.Script.SConscript
import SCons.PathList
import SCons.Util
import SCons.Warnings
-
-from .MSCommon import msvc_exists, msvc_setup_env_once
from SCons.Defaults import processDefines
from SCons.compat import PICKLE_PROTOCOL
+from .MSCommon import msvc_exists, msvc_setup_env_once
##############################################################################
# Below here are the classes and functions for generation of
@@ -782,7 +776,7 @@ class _GenerateV6DSP(_DSPGenerator):
data = pickle.loads(datas)
except KeyboardInterrupt:
raise
- except:
+ except Exception:
return # unable to unpickle any data for some reason
self.configs.update(data)
diff --git a/SCons/Tool/packaging/__init__.py b/SCons/Tool/packaging/__init__.py
index c378909..68cedeb 100644
--- a/SCons/Tool/packaging/__init__.py
+++ b/SCons/Tool/packaging/__init__.py
@@ -1,5 +1,6 @@
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,12 +21,7 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-"""SCons.Tool.Packaging
-
-SCons Packaging Tool.
-"""
-
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""SCons Packaging Tool."""
import importlib
from inspect import getfullargspec
@@ -306,8 +302,11 @@ def stripinstallbuilder(target, source, env):
and file.builder.name in ["InstallBuilder", "InstallAsBuilder"])
if len([src for src in source if has_no_install_location(src)]):
- warn(SConsWarning, "there are files to package which have no\
- InstallBuilder attached, this might lead to irreproducible packages")
+ warn(
+ SConsWarning,
+ "there are files to package which have no InstallBuilder "
+ "attached, this might lead to irreproducible packages"
+ )
n_source = []
for s in source:
diff --git a/SCons/Tool/qt.py b/SCons/Tool/qt.py
index d8a51b2..2fd7294 100644
--- a/SCons/Tool/qt.py
+++ b/SCons/Tool/qt.py
@@ -1,16 +1,6 @@
-
-"""SCons.Tool.qt
-
-Tool-specific initialization for Qt.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,8 +20,13 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""Tool-specific initialization for Qt.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+"""
import os.path
import re
diff --git a/SCons/Tool/swig.py b/SCons/Tool/swig.py
index 48d65d4..fa9d93b 100644
--- a/SCons/Tool/swig.py
+++ b/SCons/Tool/swig.py
@@ -1,14 +1,6 @@
-"""SCons.Tool.swig
-
-Tool-specific initialization for swig.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -28,9 +20,13 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""Tool-specific initialization for swig.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+"""
import os.path
import sys
@@ -42,6 +38,7 @@ import SCons.Defaults
import SCons.Tool
import SCons.Util
import SCons.Node
+import SCons.Warnings
verbose = False
@@ -190,7 +187,10 @@ def generate(env):
swig_bin_dir = os.path.dirname(swig)
env.AppendENVPath('PATH', swig_bin_dir)
else:
- SCons.Warnings.SConsWarning('swig tool requested, but binary not found in ENV PATH')
+ SCons.Warnings.warn(
+ SCons.Warnings.SConsWarning,
+ 'swig tool requested, but binary not found in ENV PATH'
+ )
if 'SWIG' not in env:
env['SWIG'] = env.Detect(swigs) or swigs[0]
diff --git a/SCons/Tool/tex.py b/SCons/Tool/tex.py
index 0ca7e2d..3a133b8 100644
--- a/SCons/Tool/tex.py
+++ b/SCons/Tool/tex.py
@@ -1,16 +1,6 @@
-"""SCons.Tool.tex
-
-Tool-specific initialization for TeX.
-Generates .dvi files from .tex files
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -30,8 +20,15 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+""" Tool-specific initialization for TeX.
+
+Generates .dvi files from .tex files
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+"""
import os.path
import re
@@ -867,7 +864,7 @@ def generate_darwin(env):
if platform.system() == 'Darwin':
try:
ospath = env['ENV']['PATHOSX']
- except:
+ except KeyError:
ospath = None
if ospath:
env.AppendENVPath('PATH', ospath)
diff --git a/SCons/Tool/xgettext.py b/SCons/Tool/xgettext.py
index ae40555..2fbebf3 100644
--- a/SCons/Tool/xgettext.py
+++ b/SCons/Tool/xgettext.py
@@ -1,9 +1,6 @@
-""" xgettext tool
-
-Tool specific initialization of `xgettext` tool.
-"""
-
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -24,7 +21,7 @@ Tool specific initialization of `xgettext` tool.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""Tool specific initialization of `xgettext` tool."""
import os
import re
@@ -35,6 +32,7 @@ import SCons.Action
import SCons.Node.FS
import SCons.Tool
import SCons.Util
+import SCons.Warnings
from SCons.Builder import BuilderBase
from SCons.Environment import _null
from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS
@@ -44,7 +42,6 @@ from SCons.Tool.GettextCommon import RPaths, _detect_xgettext
from SCons.Tool.GettextCommon import _xgettext_exists
-#############################################################################
class _CmdRunner:
""" Callable object, which runs shell command storing its stdout and stderr to
variables. It also provides `strfunction()` method, which shall be used by
@@ -81,9 +78,6 @@ class _CmdRunner:
return s
-#############################################################################
-
-#############################################################################
def _update_pot_file(target, source, env):
""" Action function for `POTUpdate` builder """
nop = lambda target, source, env: 0
@@ -160,9 +154,6 @@ def _update_pot_file(target, source, env):
return 0
-#############################################################################
-
-#############################################################################
class _POTBuilder(BuilderBase):
def _execute(self, env, target, source, *args):
if not target:
@@ -174,9 +165,6 @@ class _POTBuilder(BuilderBase):
return BuilderBase._execute(self, env, target, source, *args)
-#############################################################################
-
-#############################################################################
def _scan_xgettext_from_files(target, source, env, files=None, path=None):
""" Parses `POTFILES.in`-like file and returns list of extracted file names.
"""
@@ -226,9 +214,6 @@ def _scan_xgettext_from_files(target, source, env, files=None, path=None):
return 0
-#############################################################################
-
-#############################################################################
def _pot_update_emitter(target, source, env):
""" Emitter function for `POTUpdate` builder """
if 'XGETTEXTFROM' in env:
@@ -255,16 +240,10 @@ def _pot_update_emitter(target, source, env):
return target, source
-#############################################################################
-
-#############################################################################
def _POTUpdateBuilderWrapper(env, target=None, source=_null, **kw):
return env._POTUpdateBuilder(target, source, **kw)
-#############################################################################
-
-#############################################################################
def _POTUpdateBuilder(env, **kw):
""" Creates `POTUpdate` builder object """
kw['action'] = SCons.Action.Action(_update_pot_file, None)
@@ -274,9 +253,6 @@ def _POTUpdateBuilder(env, **kw):
return _POTBuilder(**kw)
-#############################################################################
-
-#############################################################################
def generate(env, **kw):
""" Generate `xgettext` tool """
@@ -286,7 +262,10 @@ def generate(env, **kw):
xgettext_bin_dir = os.path.dirname(xgettext)
env.AppendENVPath('PATH', xgettext_bin_dir)
else:
- SCons.Warnings.SConsWarning('xgettext tool requested, but binary not found in ENV PATH')
+ SCons.Warnings.warn(
+ SCons.Warnings.SConsWarning,
+ 'xgettext tool requested, but binary not found in ENV PATH'
+ )
try:
env['XGETTEXT'] = _detect_xgettext(env)
except:
@@ -338,9 +317,6 @@ def generate(env, **kw):
env.AlwaysBuild(env.Alias('$POTUPDATE_ALIAS'))
-#############################################################################
-
-#############################################################################
def exists(env):
""" Check, whether the tool exists """
try:
@@ -348,7 +324,6 @@ def exists(env):
except:
return False
-#############################################################################
# Local Variables:
# tab-width:4
diff --git a/SCons/Tool/yacc.py b/SCons/Tool/yacc.py
index ab019b2..61ad61a 100644
--- a/SCons/Tool/yacc.py
+++ b/SCons/Tool/yacc.py
@@ -1,15 +1,6 @@
-"""SCons.Tool.yacc
-
-Tool-specific initialization for yacc.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
+# MIT License
#
-# __COPYRIGHT__
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -29,9 +20,13 @@ selection method.
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""Tool-specific initialization for yacc.
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+"""
import os.path
import sys
@@ -39,6 +34,7 @@ import sys
import SCons.Defaults
import SCons.Tool
import SCons.Util
+import SCons.Warnings
from SCons.Platform.mingw import MINGW_DEFAULT_PATHS
from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS
from SCons.Platform.win32 import CHOCO_DEFAULT_PATH
@@ -125,7 +121,10 @@ def get_yacc_path(env, append_paths=False):
if append_paths:
env.AppendENVPath('PATH', os.path.dirname(bin_path))
return bin_path
- SCons.Warnings.SConsWarning('yacc tool requested, but yacc or bison binary not found in ENV PATH')
+ SCons.Warnings.warn(
+ SCons.Warnings.SConsWarning,
+ 'yacc tool requested, but yacc or bison binary not found in ENV PATH'
+ )
def generate(env):
diff --git a/SCons/cpp.py b/SCons/cpp.py
index 65358b3..4c6b437 100644
--- a/SCons/cpp.py
+++ b/SCons/cpp.py
@@ -23,18 +23,14 @@
"""SCons C Pre-Processor module"""
-import SCons.compat
-
import os
import re
-#
# First "subsystem" of regular expressions that we set up:
#
# Stuff to turn the C preprocessor directives in a file's contents into
# a list of tuples that we can process easily.
#
-
# A table of regular expressions that fetch the arguments from the rest of
# a C preprocessor line. Different directives have different arguments
# that we want to fetch, using the regular expressions to which the lists
diff --git a/site_scons/site_init.py b/site_scons/site_init.py
index 336cad6..faaa010 100644
--- a/site_scons/site_init.py
+++ b/site_scons/site_init.py
@@ -7,12 +7,12 @@ from Utilities import is_windows, whereis, platform, deb_date
from soe_utils import soelim, soscan, soelimbuilder
# from epydoc import epydoc_cli, epydoc_commands
from BuildCommandLine import BuildCommandLine
-from scons_local_package import install_local_package_files, create_local_packages
-from update_build_info import update_init_file
+#from scons_local_package import install_local_package_files, create_local_packages
+# from update_build_info import update_init_file
gzip = whereis('gzip')
git = os.path.exists('.git') and whereis('git')
unzip = whereis('unzip')
zip_path = whereis('zip')
-BuildCommandLine.git = git \ No newline at end of file
+BuildCommandLine.git = git