Remove dead imports and other things found by PyChecker.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 1 Jun 2004 04:41:58 +0000 (04:41 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 1 Jun 2004 04:41:58 +0000 (04:41 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@989 fdb21ef1-2011-0410-befe-b5e4ea1792b1

41 files changed:
src/engine/SCons/Builder.py
src/engine/SCons/Defaults.py
src/engine/SCons/Environment.py
src/engine/SCons/Job.py
src/engine/SCons/Node/FS.py
src/engine/SCons/Node/Python.py
src/engine/SCons/Node/__init__.py
src/engine/SCons/Platform/__init__.py
src/engine/SCons/Platform/aix.py
src/engine/SCons/Scanner/Fortran.py
src/engine/SCons/Scanner/__init__.py
src/engine/SCons/Script/__init__.py
src/engine/SCons/Tool/BitKeeper.py
src/engine/SCons/Tool/CVS.py
src/engine/SCons/Tool/Perforce.py
src/engine/SCons/Tool/RCS.py
src/engine/SCons/Tool/SCCS.py
src/engine/SCons/Tool/Subversion.py
src/engine/SCons/Tool/aixf77.py
src/engine/SCons/Tool/as.py
src/engine/SCons/Tool/cc.py
src/engine/SCons/Tool/dmd.py
src/engine/SCons/Tool/f77.py
src/engine/SCons/Tool/icc.py
src/engine/SCons/Tool/icl.py
src/engine/SCons/Tool/jar.py
src/engine/SCons/Tool/javac.py
src/engine/SCons/Tool/javah.py
src/engine/SCons/Tool/masm.py
src/engine/SCons/Tool/midl.py
src/engine/SCons/Tool/mslink.py
src/engine/SCons/Tool/msvc.py
src/engine/SCons/Tool/msvs.py
src/engine/SCons/Tool/nasm.py
src/engine/SCons/Tool/qt.py
src/engine/SCons/Tool/rmic.py
src/engine/SCons/Tool/sgic++.py
src/engine/SCons/Tool/sunc++.py
src/engine/SCons/Tool/sunlink.py
src/engine/SCons/Tool/swig.py
src/engine/SCons/Util.py

index 4aa518f383c0b6e8e93503ef0638318f0ca14a6f..733a26a13671ee5b85999a99ecc404c3392d0c00 100644 (file)
@@ -119,7 +119,6 @@ There are the following methods for internal use within this module:
 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import os.path
 import UserDict
 import UserList
 
index 4c42f2811aeed00746506110f846becba6e1d5c6..fb3669a00211cab1d91bee197fb3f97880a32de8 100644 (file)
@@ -124,6 +124,9 @@ for suffix in FortranSuffixes:
 
 IDLSuffixes = [".idl", ".IDL"]
 
+# cleanup
+del suffix
+
 # Actions for common languages.
 CAction = SCons.Action.Action("$CCCOM")
 DAction = SCons.Action.Action("$DCOM")
index d43a99f7109a5f324cd3e536aaf905a5b31de265..576652381677c5d530fc0d97bd602e264993e405 100644 (file)
@@ -39,8 +39,6 @@ import copy
 import os
 import os.path
 import string
-import re
-import shutil
 from UserDict import UserDict
 
 import SCons.Action
@@ -417,11 +415,8 @@ class Base:
     def scanner_map_delete(self, kw=None):
         """Delete the cached scanner map (if we need to).
         """
-        if not kw is None:
-            try:
-                kw['SCANNERS']
-            except KeyError:
-                return
+        if not kw is None and not kw.has_key('SCANNERS'):
+            return
         try:
             del self.scanner_map
         except AttributeError:
index 1ba7d62c918e97754738936a80693faf836152a9..e5f9a71e7c6889d1c4e1992d0f5e11e9e18ff53f 100644 (file)
@@ -168,7 +168,7 @@ else:
 
             # Create worker threads
             for i in range(num):
-                worker = Worker(self.requestQueue, self.resultsQueue)
+                Worker(self.requestQueue, self.resultsQueue)
 
         def put(self, obj):
             """Put task into request queue."""
index 13a2f52a4c3c7b8aa1e635fe3fadd8634a9f548f..1863d9301dddcacf8e013298fbc83ee3bc2b95d5 100644 (file)
@@ -1243,7 +1243,7 @@ class Dir(Base):
         """A null "builder" for directories."""
         return []
 
-    def build(self):
+    def build(self, **kw):
         """A null "builder" for directories."""
         pass
 
@@ -1673,12 +1673,12 @@ class File(Base):
 
         if calc.max_drift >= 0 and (time.time() - mtime) > calc.max_drift:
             try:
-                self.binfo
+                binfo = self.binfo
             except AttributeError:
-                self.binfo = self.new_binfo()
-            self.binfo.csig = csig
-            self.binfo.timestamp = mtime
-            self.store_info(self.binfo)
+                binfo = self.binfo = self.new_binfo()
+            binfo.csig = csig
+            binfo.timestamp = mtime
+            self.store_info(binfo)
 
         return csig
 
index a2537ae44bf0c79b56c0aeb91fe0ad80b9402a79..e15888b23fc8eb8302d8f094a802d0df15255aea 100644 (file)
@@ -67,12 +67,12 @@ class Value(SCons.Node.Node):
         timestamp, we get to ignore the calculator and just use the
         value contents."""
         try:
-            self.binfo
+            binfo = self.binfo
         except:
-            self.binfo = self.new_binfo()
+            binfo = self.binfo = self.new_binfo()
         try:
-            return self.binfo.csig
+            return binfo.csig
         except AttributeError:
-            self.binfo.csig = self.get_contents()
-            self.store_info(self.binfo)
-            return self.binfo.csig
+            binfo.csig = self.get_contents()
+            self.store_info(binfo)
+            return binfo.csig
index 66e1420186250dd5d404950c4cab2834e5e05fbe..24c70b81bf8a7c00b21c19e4bb6e5d6df49ac7d2 100644 (file)
@@ -549,15 +549,15 @@ class Node:
 
     def calc_csig(self, calc):
         try:
-            self.binfo
-        except:
-            self.binfo = self.new_binfo()
+            binfo = self.binfo
+        except AttributeError:
+            binfo = self.binfo = self.new_binfo()
         try:
-            return self.binfo.csig
+            return binfo.csig
         except AttributeError:
-            self.binfo.csig = calc.module.signature(self)
-            self.store_info(self.binfo)
-            return self.binfo.csig
+            binfo.csig = calc.module.signature(self)
+            self.store_info(binfo)
+            return binfo.csig
 
     def store_info(self, obj):
         """Make the build signature permanent (that is, store it in the
@@ -930,6 +930,7 @@ class Walker:
                         parent = None
                     self.eval_func(node, parent)
                 return node
+        return None
 
     def is_done(self):
         return not self.stack
index 84fe2088f17326de15e80469b3cb2d0cc07bd67f..e8a4a19ad13afdf5c7819510ae42f46ab4fd2ea1 100644 (file)
@@ -50,6 +50,7 @@ import string
 import sys
 
 import SCons.Errors
+import SCons.Tool
 
 def platform_default():
     """Return the platform string for our execution environment.
index 727aa9b4dd20bd2c0bfe747b8f5a08f5457b8cb6..e0d2e76d27dfb08b336a9f20ab6c9dce140e4cdf 100644 (file)
@@ -43,10 +43,7 @@ def get_xlc(env, xlc, xlc_r, packages):
     xlcPath = None
     xlcVersion = None
 
-    try:
-        xlc = env['CC']
-    except KeyError:
-        xlc = 'xlc'
+    xlc = env.get('CC', 'xlc')
     for package in packages:
         cmd = "lslpp -fc " + package + " 2>/dev/null | egrep '" + xlc + "([^-_a-zA-Z0-9].*)?$'"
         line = os.popen(cmd).readline()
index c29eec5a6745b8f1261135eb3b3d257b8309aa51..9e9a990fae70d9a0fbc3335253b1da498da1fb95 100644 (file)
@@ -29,9 +29,6 @@ This module implements the dependency scanner for Fortran code.
 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-
-import re
-
 import SCons.Node
 import SCons.Node.FS
 import SCons.Scanner
index 8432638e41dd4bb3d36d0374e4c2b9164346c156..8ea42230ffee294a662463d69a148415c0ad6c50 100644 (file)
@@ -234,7 +234,6 @@ class Current(Base):
 
     def __init__(self, *args, **kw):
         def current_check(node, env):
-            calc = env.get_calculator()
             c = not node.has_builder() or node.current(env.get_calculator())
             return c
         kw['scan_check'] = current_check
index db2b7c4851ecf62916c3068b6a063d1b02177751..d4650d209882282329b4ad97b9b2a6354c84e0ed 100644 (file)
@@ -528,7 +528,8 @@ class OptParser(OptionParser):
 
         def opt_debug(option, opt, value, parser, debug_options=debug_options):
             if value in debug_options:
-                setattr(parser.values, 'debug', value)
+                #setattr(parser.values, 'debug', value)
+                parser.values.debug = value
             else:
                 raise OptionValueError("Warning:  %s is not a valid debug type" % value)
         self.add_option('--debug', action="callback", type="string",
@@ -540,7 +541,8 @@ class OptParser(OptionParser):
         def opt_duplicate(option, opt, value, parser):
             if not value in SCons.Node.FS.Valid_Duplicates:
                 raise OptionValueError("`%s' is not a valid duplication style." % value)
-            setattr(parser.values, 'duplicate', value)
+            #setattr(parser.values, 'duplicate', value)
+            parser.values.duplicate = value
             # Set the duplicate style right away so it can affect linking
             # of SConscript files.
             SCons.Node.FS.set_duplicate(value)
@@ -582,7 +584,8 @@ class OptParser(OptionParser):
 
         def opt_j(option, opt, value, parser):
             value = int(value)
-            setattr(parser.values, 'num_jobs', value)
+            #setattr(parser.values, 'num_jobs', value)
+            parser.values.num_jobs = value
         self.add_option('-j', '--jobs', action="callback", type="int",
                         callback=opt_j, metavar="N",
                         help="Allow N jobs at once.")
@@ -750,12 +753,12 @@ class SConscriptSettableOptions:
                 value = int(value)
                 if value < 1:
                     raise ValueError
-            except ValueError, x:
+            except ValueError:
                 raise SCons.Errors.UserError, "A positive integer is required: %s"%repr(value)
         elif name == 'max_drift':
             try:
                 value = int(value)
-            except ValueError, x:
+            except ValueError:
                 raise SCons.Errors.UserError, "An integer is required: %s"%repr(value)
         elif name == 'duplicate':
             try:
index 2983c1408ac7666e6bcef020fd1c3998587a020e..c4c19404e2d62d87ac4276e721acca4327f9263f 100644 (file)
@@ -47,7 +47,8 @@ def generate(env):
         """ """
         return SCons.Builder.Builder(action = "$BITKEEPERCOM", env = env)
 
-    setattr(env, 'BitKeeper', BitKeeperFactory)
+    #setattr(env, 'BitKeeper', BitKeeperFactory)
+    env.BitKeeper = BitKeeperFactory
 
     env['BITKEEPER']         = 'bk'
     env['BITKEEPERGET']      = '$BITKEEPER get'
index 20bbb6ab4f37b53d309519c56ea65cf7ed1c11c1..3822b3b2b1153c2e984adcc9a23281202ca210dc 100644 (file)
@@ -33,8 +33,6 @@ selection method.
 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import os.path
-
 import SCons.Builder
 import SCons.Util
 
@@ -55,7 +53,8 @@ def generate(env):
                                      CVSREPOSITORY = repos,
                                      CVSMODULE = module)
 
-    setattr(env, 'CVS', CVSFactory)
+    #setattr(env, 'CVS', CVSFactory)
+    env.CVS = CVSFactory
 
     env['CVS']        = 'cvs'
     env['CVSFLAGS']   = SCons.Util.CLVar('-d $CVSREPOSITORY')
index 3813d993829f6a8498d9a341e1f11ad8d7f7fe50..0c6796ca05f89312b62149f78a65ebe4c3289b4c 100644 (file)
@@ -55,7 +55,8 @@ def generate(env):
         return SCons.Builder.Builder(action = '$P4COM',
                                      env = env)
 
-    setattr(env, 'Perforce', PerforceFactory)
+    #setattr(env, 'Perforce', PerforceFactory)
+    env.Perforce = PerforceFactory
 
     env['P4']      = 'p4'
     env['P4FLAGS'] = SCons.Util.CLVar('')
index a8f9168e90d834bb7f981526a6791016e39a9f2c..ce7ba3a8ff2c80e5dc6d947140587a912c5c3fd2 100644 (file)
@@ -44,7 +44,8 @@ def generate(env):
         """ """
         return SCons.Builder.Builder(action = '$RCS_COCOM', env = env)
 
-    setattr(env, 'RCS', RCSFactory)
+    #setattr(env, 'RCS', RCSFactory)
+    env.RCS = RCSFactory
 
     env['RCS']          = 'rcs'
     env['RCS_CO']       = 'co'
index 8230241ff529a79f509ea6ac1de42c6045fd523c..d15b49f9d06e1d6f142472a336f3d9b8598778de 100644 (file)
@@ -44,7 +44,8 @@ def generate(env):
         """ """
         return SCons.Builder.Builder(action = '$SCCSCOM', env = env)
 
-    setattr(env, 'SCCS', SCCSFactory)
+    #setattr(env, 'SCCS', SCCSFactory)
+    env.SCCS = SCCSFactory
 
     env['SCCS']         = 'sccs'
     env['SCCSFLAGS']    = SCons.Util.CLVar('')
index 85e032be43ae7bc65c406a4f4259c2519b56e7c0..23dbd97f8f71c3c487844a13a488b83309c54db1 100644 (file)
@@ -52,7 +52,8 @@ def generate(env):
                                      SVNREPOSITORY = repos,
                                      SVNMODULE = module)
 
-    setattr(env, 'Subversion', SubversionFactory)
+    #setattr(env, 'Subversion', SubversionFactory)
+    env.Subversion = SubversionFactory
 
     env['SVN']      = 'svn'
     env['SVNFLAGS'] = SCons.Util.CLVar('')
index 81db28ba1a03d01052be32a47c85e8cf7ee2dd22..8e612cd6843734ef2da9a9a9ac1841e52ae709a5 100644 (file)
@@ -34,7 +34,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import os.path
 
-import SCons.Platform.aix
+#import SCons.Platform.aix
 
 import f77
 
index 3d630e3cf1526ca9434c8939a1e3d5d27707044e..6cd4184dbfe66d41b8f57441efa46de0f569814d 100644 (file)
@@ -33,8 +33,6 @@ selection method.
 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import os.path
-
 import SCons.Defaults
 import SCons.Tool
 import SCons.Util
index f096065c0f52dd4b71f1f385d927276f8e451b6e..4c19c69068c9553dbeb330ee419c9a821dc82c9b 100644 (file)
@@ -32,8 +32,6 @@ selection method.
 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import os.path
-
 import SCons.Tool
 import SCons.Defaults
 import SCons.Util
index cf0e050b6c68b0e08cffcaae0232b5a417430343..758ed7333ff94e1ce7e1dd084f4d9031520eee2b 100644 (file)
@@ -136,7 +136,7 @@ def generate(env):
         env['DLINKFLAGPREFIX'] = '-'
         env['DLINKFLAGSUFFIX'] = ''
 
-        static_lib = SCons.Tool.createStaticLibBuilder(env)
+        SCons.Tool.createStaticLibBuilder(env)
 
         # Basically, we hijack the link and ar builders with our own.
         # these builders check for the presence of D source, and swap out
index 83941f159d7fabb4c6bef6b7ca91011fff68044f..f05a410e4f4e107dc209eb4e56bda9a597c662bf 100644 (file)
@@ -33,8 +33,6 @@ selection method.
 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import os.path
-
 import SCons.Defaults
 import SCons.Tool
 import SCons.Util
index 4a553a08dffeecd7a9b792bf3f4aa89a6342a6b3..20bf17ced9440831e4d7cb8d9f12bdb2dbcce6c9 100644 (file)
@@ -33,8 +33,6 @@ selection method.
 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import SCons.Util
-
 import cc
 
 def generate(env):
index d59647ce970897faed2a72b313b75af6a8aeec80..eeed44743b0c5f51ae4f5f1f47c8ef70c82cd965 100644 (file)
@@ -34,7 +34,6 @@ selection method.
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import os.path
-import string
 
 import SCons.Tool.msvc
 import SCons.Util
index 7934ed21e662c538fd7a3d7a01f7104c5957720a..5a74a40d6ebf6f9d1850317a2150d75031e5f17e 100644 (file)
@@ -33,9 +33,6 @@ selection method.
 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import glob
-import os.path
-
 import SCons.Builder
 import SCons.Util
 
@@ -79,7 +76,7 @@ def jarChdir(target, source, env, for_signature):
     '-C <dir>' to Jar."""
     if env.has_key('JARCHDIR'):
         return [ '-C', '$JARCHDIR' ]
-    return ''
+    return []
         
 JarBuilder = SCons.Builder.Builder(action = '$JARCOM',
                                    source_factory = SCons.Node.FS.default_fs.Entry,
@@ -88,7 +85,7 @@ JarBuilder = SCons.Builder.Builder(action = '$JARCOM',
 def generate(env):
     """Add Builders and construction variables for jar to an Environment."""
     try:
-        bld = env['BUILDERS']['Jar']
+        env['BUILDERS']['Jar']
     except KeyError:
         env['BUILDERS']['Jar'] = JarBuilder
 
index b4a5ce9b7cb06f4eda865def8d92dc18286f3e94..e16f6d0cbbca79da488316a8e2d2a3269725b936 100644 (file)
@@ -35,7 +35,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import os
 import os.path
-import re
 import string
 
 import SCons.Builder
@@ -67,8 +66,8 @@ def emit_java_classes(target, source, env):
         os.path.walk(sdir.rdir().get_abspath(), visit, slist)
 
     tlist = []
-    for file in slist:
-        pkg_dir, classes = parse_java_file(file.get_abspath())
+    for f in slist:
+        pkg_dir, classes = parse_java_file(f.get_abspath())
         if pkg_dir:
             for c in classes:
                 t = target[0].Dir(pkg_dir).File(c+class_suffix)
@@ -84,7 +83,7 @@ def emit_java_classes(target, source, env):
         else:
             # This is an odd end case:  no package and no classes.
             # Just do our best based on the source file name.
-            base = str(file)[:-len(java_suffix)]
+            base = str(f)[:-len(java_suffix)]
             t = target[0].File(base + class_suffix)
             t.attributes.java_classdir = target[0]
             t.attributes.java_classname = classname(base)
index c35f909eda38791738af8828ff6114ed3390a6ec..8f69a461834adb279c8542ba571eab2da5eb367a 100644 (file)
@@ -34,7 +34,6 @@ selection method.
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import os.path
-import re
 import string
 
 import SCons.Builder
@@ -87,7 +86,6 @@ def emit_java_headers(target, source, env):
         if not isinstance(target[0], SCons.Node.FS.Dir):
             target[0].__class__ = SCons.Node.FS.Dir
             target[0]._morph()
-        File = SCons.Node.FS.default_fs.File
         tlist = []
         for s in source:
             fname = string.replace(s.attributes.java_classname, '.', '_') + '.h'
@@ -100,7 +98,7 @@ def emit_java_headers(target, source, env):
 def JavaHOutFlagGenerator(target, source, env, for_signature):
     try:
         t = target[0]
-    except AttributeError, TypeError:
+    except (AttributeError, TypeError):
         t = target
     try:
         return '-d ' + str(t.attributes.java_lookupdir)
index 1bb9f95253757a23fb34fc4bf3beab64fb76a4b6..9fa33540e0a873ca2cd180bf19ef0058c27a2495 100644 (file)
@@ -33,8 +33,6 @@ selection method.
 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import os.path
-
 import SCons.Defaults
 import SCons.Tool
 import SCons.Util
index d02f23a6db8579b2505861a90a9d0431a0205c06..843d31bf621ac4543a880adfc4690360f00d7491 100644 (file)
@@ -33,8 +33,6 @@ selection method.
 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import os.path
-
 import SCons.Defaults
 import SCons.Scanner.IDL
 import SCons.Util
index 5ff8a011adf90f4505d1a41a4527a2d3b7db7054..534760613cab0e3388af51ec36dc78d89835c1d4 100644 (file)
@@ -48,6 +48,7 @@ def pdbGenerator(env, target, source, for_signature):
     if target and env.has_key('PDB') and env['PDB']:
         return ['/PDB:%s'%target[0].File(env['PDB']).get_string(for_signature),
                 '/DEBUG']
+    return None
 
 def win32ShlinkTargets(target, source, env, for_signature):
     listCmd = []
index 17da70233dac53d14ed42c9800c0345433e72ac6..f8d234b8189780383d23c0c16be36447144dab6c 100644 (file)
@@ -36,7 +36,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 import os.path
 import re
 import string
-import types
 
 import SCons.Action
 import SCons.Builder
index 06f850ea0c66dd80dc2c86c928d7e298f7e41c5b..ead57f235ad79defc9175bc7a0937427b6da051d 100644 (file)
@@ -407,7 +407,6 @@ class _GenerateV7DSP(_DSPGenerator):
 
         self.file.write('      <Configurations>\n')
 
-        first = 1
         confkeys = self.configs.keys()
         confkeys.sort()
         for kind in confkeys:
@@ -799,7 +798,7 @@ def get_visualstudio_versions():
             # entries are MSDN entries, not MSVS ('7.1',
             # notably), and we want to skip those too.
             try:
-                tst = SCons.Util.RegOpenKeyEx(HLM, K + '\\' + p + '\\Setup')
+                SCons.Util.RegOpenKeyEx(HLM, K + '\\' + p + '\\Setup')
             except SCons.Util.RegError:
                 continue
 
@@ -1082,7 +1081,7 @@ def generate(env):
     """Add Builders and construction variables for Microsoft Visual
     Studio project files to an Environment."""
     try:
-        bld = env['BUILDERS']['MSVSProject']
+        env['BUILDERS']['MSVSProject']
     except KeyError:
         env['BUILDERS']['MSVSProject'] = projectBuilder
 
index 84075ba5b5b6089b9e49a3251029acc35594667e..6b74341199befc013a227d8d67024a56d052a716 100644 (file)
@@ -33,8 +33,6 @@ selection method.
 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import os.path
-
 import SCons.Defaults
 import SCons.Tool
 import SCons.Util
index a0dfed882219c1681d29b57ff5700864367c23a8..01a5cf6c1eaa0e09e3cd9c83efefd18c2902ccf8 100644 (file)
@@ -36,7 +36,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import os.path
 import re
-import sys
 
 import SCons.Defaults
 import SCons.Tool
@@ -106,9 +105,9 @@ class _Automoc:
                     env.Depends(cpp, ui_h)
             if (h and q_object_search.search(h.get_contents())) or ui:
                 # h file with the Q_OBJECT macro found -> add moc_cpp
-                dir,base = os.path.split(prefix)
+                d,base = os.path.split(prefix)
                 src_ext = splitext(str(h))[1]
-                moc_cpp = FS.File(os.path.join(dir
+                moc_cpp = FS.File(os.path.join(d, 
                     env['QT_MOCNAMEGENERATOR'](base, src_ext, env)))
                 objBuilder = getattr(env, self.objBuilderName)
                 if env.get('QT_AUTOBUILD_MOC_SOURCES'):
@@ -120,9 +119,9 @@ class _Automoc:
             if cpp and q_object_search.search(cpp.get_contents()):
                 # cpp file with Q_OBJECT macro found -> add moc
                 # (to be included in cpp)
-                dir,base = os.path.split(prefix)
+                d,base = os.path.split(prefix)
                 src_ext = splitext(str(cpp))[1]
-                moc = FS.File(os.path.join(dir
+                moc = FS.File(os.path.join(d, 
                     env['QT_MOCNAMEGENERATOR'](base, src_ext, env)))
                 self.mocFromCppBld(env, moc, cpp)
                 env.Ignore(moc, moc)
index 565dc9ed3895bc2e0661883a5f1daa0d8bfb2eb0..465bd68f5a2097f756b1ff3a390d79b98d0bc98e 100644 (file)
@@ -34,7 +34,6 @@ selection method.
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 import os.path
-import re
 import string
 
 import SCons.Builder
@@ -79,7 +78,6 @@ def emit_rmic_classes(target, source, env):
         s.attributes.java_classname = classname
         slist.append(s)
 
-    File = SCons.Node.FS.default_fs.File
     tlist = []
     for s in source:
         for suff in ['_Skel', '_Stub']:
index 9081044d9262fadbceeb9f03cc0c87e7be18d60f..5461c4dcab4f0e1eb6c9578421bab68a71f7adc8 100644 (file)
@@ -33,8 +33,6 @@ selection method.
 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import os.path
-
 import SCons.Util
 
 cplusplus = __import__('c++', globals(), locals(), [])
index 230c92bb3954bc5b081983bda6ad866c7d6a55ab..673949b1731128a6f2e4fdc2840a50b64290759b 100644 (file)
@@ -10,20 +10,15 @@ selection method.
 __revision__ = ""
 
 import os.path
-import string
 
 cplusplus = __import__('c++', globals(), locals(), [])
 
 # use the package installer tool lslpp to figure out where cppc and what
 # version of it is installed
 def get_cppc(env):
-    cppcPath = None
+    cppcPath = env.get('CXX', None)
     cppcVersion = None
 
-    try:
-        cppc = env['CXX']
-    except KeyError:
-        cppc = 'cppc'
     for package in ['SPROcpl']:
         cmd = "pkginfo -l " + package + " 2>/dev/null | grep '^ *VERSION:'"
         line = os.popen(cmd).readline()
index 88624ca43c4cf117b9622cac3700ca732c82f164..476755994cc65732debf30cfc13a0e10b9ee8429 100644 (file)
@@ -48,8 +48,8 @@ try:
 except OSError:
     dirs = []
 
-for dir in dirs:
-    linker = '/opt/' + dir + '/bin/CC'
+for d in dirs:
+    linker = '/opt/' + d + '/bin/CC'
     if os.path.exists(linker):
         ccLinker = linker
         break
index b58fadc3492f32f2f64df3da61d37caece7e498f..66e601110cb615c2e1806e52009f2251bb4cc601 100644 (file)
@@ -33,8 +33,6 @@ selection method.
 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import os.path
-
 import SCons.Defaults
 import SCons.Tool
 import SCons.Util
index 8b7207ce4020533e8692c793cec33331d9b20a91..636a74fbe9d612a6452d82bafd602040c92ad79d 100644 (file)
@@ -1052,8 +1052,8 @@ else:
             path = string.split(path, os.pathsep)
         if not is_List(reject):
             reject = [reject]
-        for dir in path:
-            f = os.path.join(dir, file)
+        for d in path:
+            f = os.path.join(d, file)
             if os.path.isfile(f):
                 try:
                     st = os.stat(f)
@@ -1085,11 +1085,11 @@ def PrependPath(oldpath, newpath, sep = os.pathsep):
     orig = oldpath
     is_list = 1
     paths = orig
-    if not SCons.Util.is_List(orig):
+    if not is_List(orig):
         paths = string.split(paths, sep)
         is_list = 0
 
-    if SCons.Util.is_List(newpath):
+    if is_List(newpath):
         newpaths = newpath
     else:
         newpaths = string.split(newpath, sep)
@@ -1128,11 +1128,11 @@ def AppendPath(oldpath, newpath, sep = os.pathsep):
     orig = oldpath
     is_list = 1
     paths = orig
-    if not SCons.Util.is_List(orig):
+    if not is_List(orig):
         paths = string.split(paths, sep)
         is_list = 0
 
-    if SCons.Util.is_List(newpath):
+    if is_List(newpath):
         newpaths = newpath
     else:
         newpaths = string.split(newpath, sep)
@@ -1159,8 +1159,8 @@ def AppendPath(oldpath, newpath, sep = os.pathsep):
 
 def dir_index(directory):
     files = []
-    for file in os.listdir(directory):
-        fullname = os.path.join(directory, file)
+    for f in os.listdir(directory):
+        fullname = os.path.join(directory, f)
         files.append(fullname)
 
     # os.listdir() isn't guaranteed to return files in any specific order,
@@ -1265,12 +1265,12 @@ else:
     def case_sensitive_suffixes(s1, s2):
         return (os.path.normcase(s1) != os.path.normcase(s2))
 
-def adjustixes(file, pre, suf):
+def adjustixes(fname, pre, suf):
     if pre:
-        path, fn = os.path.split(os.path.normpath(file))
+        path, fn = os.path.split(os.path.normpath(fname))
         if fn[:len(pre)] != pre:
-            file = os.path.join(path, pre + fn)
+            fname = os.path.join(path, pre + fn)
     # Only append a suffix if the file does not have one.
-    if suf and not splitext(file)[1] and file[-len(suf):] != suf:
-            file = file + suf
-    return file
+    if suf and not splitext(fname)[1] and fname[-len(suf):] != suf:
+            fname = fname + suf
+    return fname