Get rid of the last tabs in the source files and have the TestSCons infrastructure...
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sun, 9 Oct 2005 04:47:13 +0000 (04:47 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sun, 9 Oct 2005 04:47:13 +0000 (04:47 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@1367 fdb21ef1-2011-0410-befe-b5e4ea1792b1

12 files changed:
SConstruct
etc/TestCmd.py
etc/TestSCons.py
src/CHANGES.txt
src/engine/SCons/Action.py
src/engine/SCons/Environment.py
src/engine/SCons/Optik/option.py
src/engine/SCons/Optik/option_parser.py
src/engine/SCons/Tool/msvs.py
src/engine/SCons/Tool/tex.py
test/Actions/actions.py
test/Repository/LIBPATH.py

index c4c99b354c34bb7a174eac6519f9e6d678596655..9effc18adc57968bbb982f7a37a68785f5c1b7a0 100644 (file)
@@ -287,7 +287,8 @@ env = Environment(
 
                    BUILDERS            = { 'SCons_revision' : revbuilder },
 
-                   PYTHON              = sys.executable
+                   PYTHON              = sys.executable,
+                   PYTHONFLAGS         = '-tt',
                  )
 
 Version_values = [Value(version), Value(build_id)]
@@ -643,7 +644,7 @@ for p in [ scons ]:
         env.Command(dfiles, unpack_tar_gz_files, [
             Delete(os.path.join(unpack_tar_gz_dir, pkg_version, 'build')),
             Delete("$TEST_TAR_GZ_DIR"),
-            '$PYTHON "%s" install "--prefix=$TEST_TAR_GZ_DIR" --standalone-lib' % \
+            '$PYTHON $PYTHONFLAGS "%s" install "--prefix=$TEST_TAR_GZ_DIR" --standalone-lib' % \
                 os.path.join(unpack_tar_gz_dir, pkg_version, 'setup.py'),
         ])
 
@@ -716,7 +717,7 @@ for p in [ scons ]:
         env.Command(dfiles, unpack_zip_files, [
             Delete(os.path.join(unpack_zip_dir, pkg_version, 'build')),
             Delete("$TEST_ZIP_DIR"),
-            '$PYTHON "%s" install "--prefix=$TEST_ZIP_DIR" --standalone-lib' % \
+            '$PYTHON $PYTHONFLAGS "%s" install "--prefix=$TEST_ZIP_DIR" --standalone-lib' % \
                 os.path.join(unpack_zip_dir, pkg_version, 'setup.py'),
         ])
 
@@ -812,12 +813,12 @@ for p in [ scons ]:
                                             'bdist.' + platform,
                                             'dumb')))
         for format in distutils_formats:
-            commands.append("$PYTHON $SETUP_PY bdist_dumb -f %s" % format)
+            commands.append("$PYTHON $PYTHONFLAGS $SETUP_PY bdist_dumb -f %s" % format)
 
-        commands.append("$PYTHON $SETUP_PY sdist --formats=%s" %  \
+        commands.append("$PYTHON $PYTHONFLAGS $SETUP_PY sdist --formats=%s" %  \
                             string.join(distutils_formats, ','))
 
-    commands.append("$PYTHON $SETUP_PY bdist_wininst")
+    commands.append("$PYTHON $PYTHONFLAGS $SETUP_PY bdist_wininst")
 
     env.Command(distutils_targets, build_src_files, commands)
 
@@ -837,7 +838,7 @@ for p in [ scons ]:
 
     commands = [
         Delete(local),
-        '$PYTHON $SETUP_PY install "--install-script=%s" "--install-lib=%s" --no-install-man --no-compile --standalone-lib --no-version-script' % \
+        '$PYTHON $PYTHONFLAGS $SETUP_PY install "--install-script=%s" "--install-lib=%s" --no-install-man --no-compile --standalone-lib --no-version-script' % \
                                                 (cwd_local, cwd_local_slv),
     ]
 
@@ -1021,11 +1022,11 @@ if change:
                                     'scons',
                                     'build')),
                 Delete("$TEST_SRC_TAR_GZ_DIR"),
-                'cd "%s" && $PYTHON "%s" "%s"' % \
+                'cd "%s" && $PYTHON $PYTHONFLAGS "%s" "%s"' % \
                     (os.path.join(unpack_tar_gz_dir, psv),
                      os.path.join('src', 'script', 'scons.py'),
                      os.path.join('build', 'scons')),
-                '$PYTHON "%s" install "--prefix=$TEST_SRC_TAR_GZ_DIR" --standalone-lib' % \
+                '$PYTHON $PYTHONFLAGS "%s" install "--prefix=$TEST_SRC_TAR_GZ_DIR" --standalone-lib' % \
                     os.path.join(unpack_tar_gz_dir,
                                  psv,
                                  'build',
@@ -1077,11 +1078,11 @@ if change:
                                     'scons',
                                     'build')),
                 Delete("$TEST_SRC_ZIP_DIR"),
-                'cd "%s" && $PYTHON "%s" "%s"' % \
+                'cd "%s" && $PYTHON $PYTHONFLAGS "%s" "%s"' % \
                     (os.path.join(unpack_zip_dir, psv),
                      os.path.join('src', 'script', 'scons.py'),
                      os.path.join('build', 'scons')),
-                '$PYTHON "%s" install "--prefix=$TEST_SRC_ZIP_DIR" --standalone-lib' % \
+                '$PYTHON $PYTHONFLAGS "%s" install "--prefix=$TEST_SRC_ZIP_DIR" --standalone-lib' % \
                     os.path.join(unpack_zip_dir,
                                  psv,
                                  'build',
index e4cae74a1a8d1b831eb0e9ab8d83f81d44a6ae11..83696ea9dffe7ba05d84f5a54e5011285ab7e5a7 100644 (file)
@@ -38,6 +38,7 @@ things.  Here is an overview of them:
     test.program_set('program_or_script_to_test')
 
     test.interpreter_set('script_interpreter')
+    test.interpreter_set(['script_interpreter', 'arg'])
 
     test.workdir_set('prefix')
     test.workdir_set('')
@@ -175,8 +176,8 @@ version.
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 
 __author__ = "Steven Knight <knight at baldmt dot com>"
-__revision__ = "TestCmd.py 0.16.D002 2005/08/19 16:58:31 knight"
-__version__ = "0.16"
+__revision__ = "TestCmd.py 0.17.D001 2005/10/08 22:58:27 knight"
+__version__ = "0.17"
 
 import os
 import os.path
@@ -658,11 +659,13 @@ class TestCmd:
             program = self.program
             if not interpreter:
                 interpreter = self.interpreter
-        if type(program) != type([]):
+        if not type(program) in [type([]), type(())]:
             program = [program]
-        cmd = program
+        cmd = list(program)
         if interpreter:
-            cmd = [interpreter] + cmd
+            if not type(interpreter) in [type([]), type(())]:
+                interpreter = [interpreter]
+            cmd = list(interpreter) + cmd
         if arguments:
             if type(arguments) == type(''):
                 arguments = string.split(arguments)
index b49afaddf67f04b2d71a8684af32d204dca2f2ac..5dce7681ae84746cf7b96513cef0fdb8497800e1 100644 (file)
@@ -131,7 +131,7 @@ class TestSCons(TestCommon):
                 else:
                     kw['program'] = 'scons.py'
        if not kw.has_key('interpreter') and not os.environ.get('SCONS_EXEC'):
-           kw['interpreter'] = python
+           kw['interpreter'] = [python, '-tt']
        if not kw.has_key('match'):
            kw['match'] = match_exact
        if not kw.has_key('workdir'):
index 383be62731a674a056c7d9465baa2b75140b0d51..b169fde4352e0adeaa354c2ba174f7cf3e30b7e4 100644 (file)
@@ -349,6 +349,10 @@ RELEASE 0.97 - XXX
     throw a KeyError if we were able to delte the variable from any
     Environment in the stack.
 
+  - Get rid of the last indentation tabs in the SCons source files and
+    add -tt to the Python invocations in the packaging build and the
+    tests so they don't creep back in.
+
   From Chen Lee:
 
   - Handle Visual Studio project and solution files in Unicode.
index 0bbcc3a57301257b6b7a77dc6991e4aa3f2133aa..98de34e75405d6708daa62839336f99f9e921447 100644 (file)
@@ -409,8 +409,8 @@ class CommandAction(_ActionAction):
             if c:
                 return c
         cmd_list, ignore, silent = self.process(target, source, env)
-       if silent:
-           return ''
+        if silent:
+            return ''
         return _string_from_cmd_list(cmd_list[0])
 
     def execute(self, target, source, env):
@@ -462,7 +462,7 @@ class CommandAction(_ActionAction):
                     # reasonable for just about everything else:
                     ENV[key] = str(value)
 
-       cmd_list, ignore, silent = self.process(target, map(rfile, source), env)
+        cmd_list, ignore, silent = self.process(target, map(rfile, source), env)
 
         # Use len() to filter out any "command" that's zero-length.
         for cmd_line in filter(len, cmd_list):
index 08e085d64cdb928fd03882111a5a581c190bae33..b4e8aac47fdb8a0efafd4b18746fe4289826e1cf 100644 (file)
@@ -791,12 +791,12 @@ class Base(SubstitutionEnvironment):
         return None
 
     def Dictionary(self, *args):
-       if not args:
-           return self._dict
-       dlist = map(lambda x, s=self: s._dict[x], args)
-       if len(dlist) == 1:
-           dlist = dlist[0]
-       return dlist
+        if not args:
+            return self._dict
+        dlist = map(lambda x, s=self: s._dict[x], args)
+        if len(dlist) == 1:
+            dlist = dlist[0]
+        return dlist
 
     def Dump(self, key = None):
         """
index 2e1ec33af99468e742374a732abc364bf4024631..7493205d4d6ea35043db9637fea36620c7d41254 100644 (file)
@@ -346,8 +346,8 @@ class Option:
             if self.nargs == 1:
                 value = self.check_value(opt, value)
             else:
-               def cv(v,check=self.check_value,o=opt):
-                   return check(o,v)
+                def cv(v,check=self.check_value,o=opt):
+                    return check(o,v)
 
                 value = tuple(map(cv,value))
 
index 94375d0023a6e4bb163458391e7a466a85843ac5..49b1874e39930a5b60dd62bdb1c8ea3ac9949e57 100644 (file)
@@ -530,8 +530,8 @@ class OptionParser:
         (basename of sys.argv[0]).  Does nothing if self.usage is empty
         or not defined.
         """
-       if file is None:
-           file = sys.stdout
+        if file is None:
+            file = sys.stdout
         if self.usage:
             usage = string.replace(self.usage,"%prog", get_prog_name())
             file.write(usage + "\n")
@@ -544,8 +544,8 @@ class OptionParser:
         of "%prog" in self.version is replaced by the current program's
         name.  Does nothing if self.version is empty or undefined.
         """
-       if file is None:
-           file = sys.stdout
+        if file is None:
+            file = sys.stdout
         if self.version:
             version = string.replace(self.version,"%prog", get_prog_name())
             file.write(version+"\n")
@@ -649,10 +649,10 @@ def _match_abbrev (s, wordmap):
     else:
         # Isolate all words with s as a prefix.
         possibilities = []
-       ls = len(s)
-       for word in wordmap.keys():
+        ls = len(s)
+        for word in wordmap.keys():
             if len(word)>=ls and word[:ls]==s:
-               possibilities.append(word)
+                possibilities.append(word)
         # No exact match, so there had better be just one possibility.
         if len(possibilities) == 1:
             return possibilities[0]
index 280c456407e37d8814748502aa603b1a4c43d262..5542a883c96813bda3936010bed672bc403c5f0c 100644 (file)
@@ -197,7 +197,7 @@ class _DSPGenerator:
             for v in variants:
                 outdir.append(s)
 
-       self.sconscript = env['MSVSSCONSCRIPT']
+        self.sconscript = env['MSVSSCONSCRIPT']
 
         self.env = env
 
index db2664a354b3b1a031c8963acaae22aac5bc5aa5..adb6c06ec287f6e6ea8163b1ca87b3d8efb16b2f 100644 (file)
@@ -81,7 +81,7 @@ def is_LaTeX(flist):
     for f in flist:
         content = f.get_contents()
         if LaTeX_re.search(content):
-           return 1
+            return 1
     return 0
 
 def TeXLaTeXFunction(target = None, source= None, env=None):
@@ -89,9 +89,9 @@ def TeXLaTeXFunction(target = None, source= None, env=None):
     decide the "flavor" of the source and then executes the appropriate
     program."""
     if is_LaTeX(source):
-       LaTeXAuxAction(target,source,env)
+        LaTeXAuxAction(target,source,env)
     else:
-       TeXAction(target,source,env)
+        TeXAction(target,source,env)
     return 0
 
 TeXLaTeXAction = SCons.Action.Action(TeXLaTeXFunction,
index c805a0500788899f3a335b1e35192126310d0821..7ae951a34e34e053467b566a41a80e98eebc5387 100644 (file)
@@ -94,7 +94,7 @@ class bld:
         self.cmd = r'%s build.py %%s 4 %%s'
     def __call__(self, env, target, source):
         cmd = self.get_contents(env, target, source)
-       print cmd
+        print cmd
         return os.system(cmd)
     def get_contents(self, env, target, source):
         return self.cmd %% (string.join(map(str, target)),
index 4b249e52758d8196a0400d624b99c510de7b904d..8f0a12f2460e0213f322f03ed207c180b67e760d 100644 (file)
@@ -50,10 +50,10 @@ def write_LIBDIRFLAGS(env, target, source):
     suf = env.subst('$LIBDIRSUFFIX')
     f = open(str(target[0]), 'wb')
     for arg in string.split(env.subst('$_LIBDIRFLAGS', target=target)):
-       if arg[:len(pre)] == pre:
-           arg = arg[len(pre):]
-       if arg[-len(suf):] == suf:
-           arg = arg[:-len(pre)]
+        if arg[:len(pre)] == pre:
+            arg = arg[len(pre):]
+        if arg[-len(suf):] == suf:
+            arg = arg[:-len(pre)]
         f.write(arg + '\n')
     f.close()
     return 0