dirkbaechle avatar dirkbaechle committed 2bcfa2e

- additional corrections for left alignment

Comments (0)

Files changed (15)

doc/generated/variables.gen

   <varlistentry id="cv-ZIPROOT">
     <term>ZIPROOT</term>
     <listitem>
+<para xmlns="http://www.scons.org/dbxsd/v1.0">
 An optional zip root directory (default empty).  The filenames stored
 in the zip file will be relative to this directory, if given.
 Otherwise the filenames are relative to the current directory of the
 command.
 For instance:
+</para>
 <example_commands xmlns="http://www.scons.org/dbxsd/v1.0">
 env = Environment()
 env.Zip('foo.zip', 'subdir1/subdir2/file1', ZIPROOT='subdir1')

doc/user/add-method.xml

 
   <scons_example name="addmethod_ex2">
      <file name="SConstruct" printme="1">
-     def BuildTestProg(env, testfile, resourcefile, testdir="tests"):
-         """Build the test program;
-         prepends "test_" to src and target,
-         and puts target into testdir."""
-         srcfile = "test_%s.c" % testfile
-         target = "%s/test_%s" % (testdir, testfile)
-         if env['PLATFORM'] == 'win32':
-             resfile = env.RES(resourcefile)
-             p = env.Program(target, [srcfile, resfile])
-         else:
-             p = env.Program(target, srcfile)
-         return p
-     AddMethod(Environment, BuildTestProg)
+def BuildTestProg(env, testfile, resourcefile, testdir="tests"):
+    """Build the test program;
+    prepends "test_" to src and target,
+    and puts target into testdir."""
+    srcfile = "test_%s.c" % testfile
+    target = "%s/test_%s" % (testdir, testfile)
+    if env['PLATFORM'] == 'win32':
+        resfile = env.RES(resourcefile)
+        p = env.Program(target, [srcfile, resfile])
+    else:
+        p = env.Program(target, srcfile)
+    return p
+AddMethod(Environment, BuildTestProg)
 
-     env = Environment()
-     env.BuildTestProg('stuff', resourcefile='res.rc')
+env = Environment()
+env.BuildTestProg('stuff', resourcefile='res.rc')
      </file>
      <file name="test_stuff.c">
-     int main() { printf("Hello, world!\n"); }
+int main() { printf("Hello, world!\n"); }
      </file>
      <file name="res.rc">
-     res.rc
+res.rc
      </file>
   </scons_example>
 

doc/user/builders-writing.xml

     <scons_example name="builderswriting_MY_EMITTER">
 
       <file name="SConstruct" printme="1">
-        bld = Builder(action = 'my_command $SOURCES &gt; $TARGET',
-                      suffix = '.foo',
-                      src_suffix = '.input',
-                      emitter = '$MY_EMITTER')
-        def modify1(target, source, env):
-            return target, source + ['modify1.in']
-        def modify2(target, source, env):
-            return target, source + ['modify2.in']
-        env1 = Environment(BUILDERS = {'Foo' : bld},
-                           MY_EMITTER = modify1)
-        env2 = Environment(BUILDERS = {'Foo' : bld},
-                           MY_EMITTER = modify2)
-        env1.Foo('file1')
-        env2.Foo('file2')
-        import os
-        env1['ENV']['PATH'] = env2['ENV']['PATH'] + os.pathsep + os.getcwd()
-        env2['ENV']['PATH'] = env2['ENV']['PATH'] + os.pathsep + os.getcwd()
+bld = Builder(action = 'my_command $SOURCES &gt; $TARGET',
+              suffix = '.foo',
+              src_suffix = '.input',
+              emitter = '$MY_EMITTER')
+def modify1(target, source, env):
+    return target, source + ['modify1.in']
+def modify2(target, source, env):
+    return target, source + ['modify2.in']
+env1 = Environment(BUILDERS = {'Foo' : bld},
+                   MY_EMITTER = modify1)
+env2 = Environment(BUILDERS = {'Foo' : bld},
+                   MY_EMITTER = modify2)
+env1.Foo('file1')
+env2.Foo('file2')
+import os
+env1['ENV']['PATH'] = env2['ENV']['PATH'] + os.pathsep + os.getcwd()
+env2['ENV']['PATH'] = env2['ENV']['PATH'] + os.pathsep + os.getcwd()
         </file>
         <file name="file1.input">
-        file1.input
+file1.input
         </file>
         <file name="file2.input">
-        file2.input
+file2.input
         </file>
         <file name="modify1.in">
-        modify1.input
+modify1.input
         </file>
         <file name="modify2.in">
-        modify2.input
+modify2.input
         </file>
         <file name="my_command" chmod="0755">
-        cat
+cat
         </file>
 
     </scons_example>

doc/user/caching.xml

       <scons_output_command>scons -Q - -random</scons_output_command>
     </scons_output>
 
-    We captured it directly here to guarantee a "random" order,
-    guarding against the potential for - -random to happen
-    to return things in the original sorted order.
+We captured it directly here to guarantee a "random" order,
+guarding against the potential for - -random to happen
+to return things in the original sorted order.
 
-    -->
+-->
 
     <screen>
-      % <userinput>scons -Q --random</userinput>
-      cc -o f3.o -c f3.c
-      cc -o f1.o -c f1.c
-      cc -o f5.o -c f5.c
-      cc -o f2.o -c f2.c
-      cc -o f4.o -c f4.c
-      cc -o prog f1.o f2.o f3.o f4.o f5.o
+  % <userinput>scons -Q --random</userinput>
+  cc -o f3.o -c f3.c
+  cc -o f1.o -c f1.c
+  cc -o f5.o -c f5.c
+  cc -o f2.o -c f2.c
+  cc -o f4.o -c f4.c
+  cc -o prog f1.o f2.o f3.o f4.o f5.o
     </screen>
 
     <para>

doc/user/command-line.xml

 
       <scons_example name="commandline_AddOption">
         <file name="SConstruct" printme="1">
-        AddOption('--prefix',
-                  dest='prefix',
-                  type='string',
-                  nargs=1,
-                  action='store',
-                  metavar='DIR',
-                  help='installation prefix')
-
-        env = Environment(PREFIX = GetOption('prefix'))
-
-        installed_foo = env.Install('$PREFIX/usr/bin', 'foo.in')
-        Default(installed_foo)
+AddOption('--prefix',
+          dest='prefix',
+          type='string',
+          nargs=1,
+          action='store',
+          metavar='DIR',
+          help='installation prefix')
+
+env = Environment(PREFIX = GetOption('prefix'))
+
+installed_foo = env.Install('$PREFIX/usr/bin', 'foo.in')
+Default(installed_foo)
         </file>
         <file name="foo.in">
-        foo.in
+foo.in
         </file>
       </scons_example>
 
 
       <scons_example name="commandline_Variables_custom_py_2">
         <file name="SConstruct">
-           vars = Variables('custom.py')
-           vars.Add('RELEASE', 'Set to 1 to build for release', 0)
-           env = Environment(variables = vars,
-                             CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'})
-           env.Program(['foo.c', 'bar.c'])
-           Help(vars.GenerateHelpText(env))
+   vars = Variables('custom.py')
+   vars.Add('RELEASE', 'Set to 1 to build for release', 0)
+   env = Environment(variables = vars,
+                     CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'})
+   env.Program(['foo.c', 'bar.c'])
+   Help(vars.GenerateHelpText(env))
         </file>
         <file name="foo.c">
-        foo.c
+foo.c
         </file>
         <file name="bar.c">
-        bar.c
+bar.c
         </file>
         <file name="custom.py" printme="1">
-        RELEASE = 0
+RELEASE = 0
         </file>
       </scons_example>
 

doc/user/depends.xml

     f = open("test.txt","a")
     f.write("some line\n")
     f.close()
-    
+
 update_file()
 
 # Activate our own decider function
 
     <scons_example name="depends_macroinc">
       <file name="hello.c" printme="1">
-      #define FOO_HEADER &lt;foo.h&gt;
-      #include FOO_HEADER
+#define FOO_HEADER &lt;foo.h&gt;
+#include FOO_HEADER
 
-      int main() {
-          return FOO;
-      }
+int main() {
+    return FOO;
+}
       </file>
       <file name="SConstruct">
-      Program('hello', 'hello.c', CPPPATH='.')
+Program('hello', 'hello.c', CPPPATH='.')
       </file>
       <file name="foo.h">
-      #define FOO 42
+#define FOO 42
       </file>
     </scons_example>
 
 
     <scons_example name="depends_parsedep">
       <file name="hello.c">
-      #define FOO_HEADER &lt;foo.h&gt;
-      #include FOO_HEADER
+#define FOO_HEADER &lt;foo.h&gt;
+#include FOO_HEADER
 
-      int main() {
-          return FOO;
-      }
+int main() {
+    return FOO;
+}
       </file>
       <file name="SConstruct" printme="1">
-      obj = Object('hello.c', CCFLAGS='-MD -MF hello.d', CPPPATH='.')
-      SideEffect('hello.d', obj)
-      ParseDepends('hello.d')
-      Program('hello', obj)
+obj = Object('hello.c', CCFLAGS='-MD -MF hello.d', CPPPATH='.')
+SideEffect('hello.d', obj)
+ParseDepends('hello.d')
+Program('hello', obj)
       </file>
       <file name="foo.h">
-      #define FOO 42
+#define FOO 42
       </file>
       <file name="hello.d">
-      hello.o: hello.c foo.h
+hello.o: hello.c foo.h
       </file>
     </scons_example>
 
 
     <scons_example name="depends_parsedeprebuild">
       <file name="hello.c">
-      #define FOO_HEADER &lt;foo.h&gt;
-      #include FOO_HEADER
+#define FOO_HEADER &lt;foo.h&gt;
+#include FOO_HEADER
 
-      int main() {
-          return FOO;
-      }
+int main() {
+    return FOO;
+}
       </file>
       <file name="SConstruct">
-      obj = Object('hello.c', CCFLAGS='-MD -MF hello.d', CPPPATH='.')
-      SideEffect('hello.d', obj)
-      ParseDepends('hello.d')
-      Program('hello', obj)
+obj = Object('hello.c', CCFLAGS='-MD -MF hello.d', CPPPATH='.')
+SideEffect('hello.d', obj)
+ParseDepends('hello.d')
+Program('hello', obj)
       </file>
       <file name="foo.h">
-      #define FOO 42
+#define FOO 42
       </file>
     </scons_example>
 
 
     <scons_example name="depends_no-Requires">
       <file name="SConstruct" printme="1">
-      import time
+import time
 
-      version_c_text = """
-      char *date = "%s";
-      """ % time.ctime(time.time())
-      open('version.c', 'w').write(version_c_text)
+version_c_text = """
+char *date = "%s";
+""" % time.ctime(time.time())
+open('version.c', 'w').write(version_c_text)
 
-      hello = Program(['hello.c', 'version.c'])
+hello = Program(['hello.c', 'version.c'])
       </file>
       <file name="hello.c">
-      extern char *date;
-      int main() { printf("Hello, %s!  I was built: %s\n", date); }
+extern char *date;
+int main() { printf("Hello, %s!  I was built: %s\n", date); }
       </file>
     </scons_example>
 
 
     <scons_example name="depends_Requires">
       <file name="SConstruct" printme="1">
-      import time
+import time
 
-      version_c_text = """
-      char *date = "%s";
-      """ % time.ctime(time.time())
-      open('version.c', 'w').write(version_c_text)
+version_c_text = """
+char *date = "%s";
+""" % time.ctime(time.time())
+open('version.c', 'w').write(version_c_text)
 
-      version_obj = Object('version.c')
+version_obj = Object('version.c')
 
-      hello = Program('hello.c',
-                      LINKFLAGS = str(version_obj[0]))
+hello = Program('hello.c',
+                LINKFLAGS = str(version_obj[0]))
 
-      Requires(hello, version_obj)
+Requires(hello, version_obj)
       </file>
       <file name="hello.c">
-      extern char *date;
-      int main() { printf("Hello, %s!  I was built: %s\n", date); }
+extern char *date;
+int main() { printf("Hello, %s!  I was built: %s\n", date); }
       </file>
     </scons_example>
 

doc/user/environments.xml

 
        <scons_example name="environments_ex1">
          <file name="SConstruct" printme="1">
-         env = Environment(CC = 'gcc',
-                           CCFLAGS = '-O2')
+ env = Environment(CC = 'gcc',
+                   CCFLAGS = '-O2')
 
-         env.Program('foo.c')
+ env.Program('foo.c')
          </file>
          <file name="foo.c">
-        int main() { }
+int main() { }
          </file>
        </scons_example>
 
        <scons_output example="environments_missing3" suffix="1">
           <scons_output_command>scons -Q</scons_output_command>
        </scons_output>
-      <sconstruct>
-      </sconstruct>
 
       <para>
       If &AllowSubstExceptions; is called multiple times, each call
       </para>
 
       <sconstruct>
-
-      DefaultEnvironment(CC = '/usr/local/bin/gcc')
-
+DefaultEnvironment(CC = '/usr/local/bin/gcc')
       </sconstruct>
 
       <para>
       </para>
 
       <sconstruct>
-
-      env = DefaultEnvironment()
-      env['CC'] = '/usr/local/bin/gcc'
-
+env = DefaultEnvironment()
+env['CC'] = '/usr/local/bin/gcc'
       </sconstruct>
 
       <para>
       </para>
 
       <sconstruct>
-
-      env = DefaultEnvironment(tools = ['gcc', 'gnulink'],
-                               CC = '/usr/local/bin/gcc')
-
+env = DefaultEnvironment(tools = ['gcc', 'gnulink'],
+                         CC = '/usr/local/bin/gcc')
       </sconstruct>
 
       <para>
 
       <scons_example name="environments_ex2">
         <file name="SConstruct" printme="1">
-         opt = Environment(CCFLAGS = '-O2')
-         dbg = Environment(CCFLAGS = '-g')
+opt = Environment(CCFLAGS = '-O2')
+dbg = Environment(CCFLAGS = '-g')
 
-         opt.Program('foo', 'foo.c')
+opt.Program('foo', 'foo.c')
 
-         dbg.Program('bar', 'bar.c')
+dbg.Program('bar', 'bar.c')
         </file>
         <file name="foo.c">
-        int main() { }
+int main() { }
         </file>
         <file name="bar.c">
-        int main() { }
+int main() { }
         </file>
       </scons_example>
 
 
       <scons_example name="environments_ex3">
         <file name="SConstruct" printme="1">
-         opt = Environment(CCFLAGS = '-O2')
-         dbg = Environment(CCFLAGS = '-g')
+opt = Environment(CCFLAGS = '-O2')
+dbg = Environment(CCFLAGS = '-g')
 
-         opt.Program('foo', 'foo.c')
+opt.Program('foo', 'foo.c')
 
-         dbg.Program('foo', 'foo.c')
+dbg.Program('foo', 'foo.c')
         </file>
         <file name="foo.c">
-        int main() { }
+int main() { }
         </file>
       </scons_example>
 
 
       <scons_example name="environments_ex4">
         <file name="SConstruct" printme="1">
-         opt = Environment(CCFLAGS = '-O2')
-         dbg = Environment(CCFLAGS = '-g')
+opt = Environment(CCFLAGS = '-O2')
+dbg = Environment(CCFLAGS = '-g')
 
-         o = opt.Object('foo-opt', 'foo.c')
-         opt.Program(o)
+o = opt.Object('foo-opt', 'foo.c')
+opt.Program(o)
 
-         d = dbg.Object('foo-dbg', 'foo.c')
-         dbg.Program(d)
+d = dbg.Object('foo-dbg', 'foo.c')
+dbg.Program(d)
         </file>
         <file name="foo.c">
-        int main() { }
+int main() { }
         </file>
       </scons_example>
 
 
       <scons_example name="environments_ex5">
         <file name="SConstruct" printme="1">
-         env = Environment(CC = 'gcc')
-         opt = env.Clone(CCFLAGS = '-O2')
-         dbg = env.Clone(CCFLAGS = '-g')
+env = Environment(CC = 'gcc')
+opt = env.Clone(CCFLAGS = '-O2')
+dbg = env.Clone(CCFLAGS = '-g')
 
-         env.Program('foo', 'foo.c')
+env.Program('foo', 'foo.c')
 
-         o = opt.Object('foo-opt', 'foo.c')
-         opt.Program(o)
+o = opt.Object('foo-opt', 'foo.c')
+opt.Program(o)
 
-         d = dbg.Object('foo-dbg', 'foo.c')
-         dbg.Program(d)
+d = dbg.Object('foo-dbg', 'foo.c')
+dbg.Program(d)
         </file>
         <file name="foo.c">
-        int main() { }
+int main() { }
         </file>
       </scons_example>
 
 
       <scons_example name="environments_Replace2">
         <file name="SConstruct" printme="1">
-         env = Environment(CCFLAGS = '-DDEFINE1')
-         print "CCFLAGS =", env['CCFLAGS']
-         env.Program('foo.c')
+env = Environment(CCFLAGS = '-DDEFINE1')
+print "CCFLAGS =", env['CCFLAGS']
+env.Program('foo.c')
 
-         env.Replace(CCFLAGS = '-DDEFINE2')
-         print "CCFLAGS =", env['CCFLAGS']
-         env.Program('bar.c')
+env.Replace(CCFLAGS = '-DDEFINE2')
+print "CCFLAGS =", env['CCFLAGS']
+env.Program('bar.c')
         </file>
         <file name="foo.c">
-        int main() { }
+int main() { }
         </file>
         <file name="bar.c">
-        int main() { }
+int main() { }
         </file>
       </scons_example>
 

doc/user/less-simple.xml

     </para>
 
     <sconstruct>
-       common_sources = ['file1.c', 'file2.c']
+common_sources = ['file1.c', 'file2.c']
 
-       # THE FOLLOWING IS INCORRECT AND GENERATES A PYTHON ERROR
-       # BECAUSE IT TRIES TO ADD A STRING TO A LIST:
-       Program('program1', common_sources + 'program1.c')
+# THE FOLLOWING IS INCORRECT AND GENERATES A PYTHON ERROR
+# BECAUSE IT TRIES TO ADD A STRING TO A LIST:
+Program('program1', common_sources + 'program1.c')
 
-       # The following works correctly, because it's adding two
-       # lists together to make another list.
-       Program('program2', common_sources + ['program2.c'])
+# The following works correctly, because it's adding two
+# lists together to make another list.
+Program('program2', common_sources + ['program2.c'])
     </sconstruct>
 
     </important>

doc/user/misc.xml

 
     <scons_example name="misc_Flatten2">
       <file name="SConstruct" printme="1">
-      objects = [
-          Object('prog1.c'),
-          Object('prog2.c', CCFLAGS='-DFOO'),
-      ]
-      Program(objects)
+objects = [
+    Object('prog1.c'),
+    Object('prog2.c', CCFLAGS='-DFOO'),
+]
+Program(objects)
 
-      for object_file in objects:
-          print object_file.abspath
+for object_file in objects:
+    print object_file.abspath
       </file>
       <file name="prog1.c">
-      prog1.c
+prog1.c
       </file>
       <file name="prog2.c">
-      prog2.c
+prog2.c
       </file>
     </scons_example>
 
 
     <scons_example name="misc_Flatten3">
       <file name="SConstruct" printme="1">
-      objects = [
-          Object('prog1.c'),
-          Object('prog2.c', CCFLAGS='-DFOO'),
-      ]
-      Program(objects)
+objects = [
+    Object('prog1.c'),
+    Object('prog2.c', CCFLAGS='-DFOO'),
+]
+Program(objects)
 
-      for object_file in Flatten(objects):
-          print object_file.abspath
+for object_file in Flatten(objects):
+    print object_file.abspath
       </file>
       <file name="prog1.c">
-      prog1.c
+prog1.c
       </file>
       <file name="prog2.c">
-      prog2.c
+prog2.c
       </file>
     </scons_example>
 

doc/user/nodes.xml

 
     <scons_example name="nodes_print">
       <file name="SConstruct" printme="1">
-      hello_c = File('hello.c')
-      Program(hello_c)
+hello_c = File('hello.c')
+Program(hello_c)
 
-      classes = Dir('classes')
-      Java(classes, 'src')
+classes = Dir('classes')
+Java(classes, 'src')
       </file>
     </scons_example>
 

doc/user/output.xml

 
     <scons_example name="output_ex2">
        <file name="SConstruct" printme="1">
-       env = Environment()
+env = Environment()
 
-       Help("\nType: 'scons program' to build the production program.\n")
+Help("\nType: 'scons program' to build the production program.\n")
 
-       if env['PLATFORM'] == 'win32':
-           Help("\nType: 'scons windebug' to build the Windows debug version.\n")
+if env['PLATFORM'] == 'win32':
+    Help("\nType: 'scons windebug' to build the Windows debug version.\n")
        </file>
     </scons_example>
 
 
     <scons_example name="output_Progress-callable">
       <file name="SConstruct" printme="1">
-        screen = open('/dev/tty', 'w')
-        count = 0
-        def progress_function(node)
-            count += 1
-            screen.write('Node %4d: %s\r' % (count, node))
+screen = open('/dev/tty', 'w')
+count = 0
+def progress_function(node)
+    count += 1
+    screen.write('Node %4d: %s\r' % (count, node))
 
-        Progress(progress_function)
+Progress(progress_function)
       </file>
     </scons_example>
 
 
     <scons_example name="output_gbf1">
       <file name="SConstruct" printme="1">
-        import atexit
+import atexit
 
-        def print_build_failures():
-            from SCons.Script import GetBuildFailures
-            for bf in GetBuildFailures():
-                print "%s failed: %s" % (bf.node, bf.errstr)
-        atexit.register(print_build_failures)
+def print_build_failures():
+    from SCons.Script import GetBuildFailures
+    for bf in GetBuildFailures():
+        print "%s failed: %s" % (bf.node, bf.errstr)
+atexit.register(print_build_failures)
       </file>
     </scons_example>
 
 
     <scons_example name="output_gbf2">
       <file name="SConstruct" printme="1">
-        # Make the build fail if we pass fail=1 on the command line
-        if ARGUMENTS.get('fail', 0):
-            Command('target', 'source', ['/bin/false'])
+# Make the build fail if we pass fail=1 on the command line
+if ARGUMENTS.get('fail', 0):
+    Command('target', 'source', ['/bin/false'])
 
-        def bf_to_str(bf):
-            """Convert an element of GetBuildFailures() to a string
-            in a useful way."""
-            import SCons.Errors
-            if bf is None: # unknown targets product None in list
-                return '(unknown tgt)'
-            elif isinstance(bf, SCons.Errors.StopError):
-                return str(bf)
-            elif bf.node:
-                return str(bf.node) + ': ' + bf.errstr
-            elif bf.filename:
-                return bf.filename + ': ' + bf.errstr
-            return 'unknown failure: ' + bf.errstr
-        import atexit
+def bf_to_str(bf):
+    """Convert an element of GetBuildFailures() to a string
+    in a useful way."""
+    import SCons.Errors
+    if bf is None: # unknown targets product None in list
+        return '(unknown tgt)'
+    elif isinstance(bf, SCons.Errors.StopError):
+        return str(bf)
+    elif bf.node:
+        return str(bf.node) + ': ' + bf.errstr
+    elif bf.filename:
+        return bf.filename + ': ' + bf.errstr
+    return 'unknown failure: ' + bf.errstr
+import atexit
 
-        def build_status():
-            """Convert the build status to a 2-tuple, (status, msg)."""
-            from SCons.Script import GetBuildFailures
-            bf = GetBuildFailures()
-            if bf:
-                # bf is normally a list of build failures; if an element is None,
-                # it's because of a target that scons doesn't know anything about.
-                status = 'failed'
-                failures_message = "\n".join(["Failed building %s" % bf_to_str(x)
-                                   for x in bf if x is not None])
-            else:
-                # if bf is None, the build completed successfully.
-                status = 'ok'
-                failures_message = ''
-            return (status, failures_message)
+def build_status():
+    """Convert the build status to a 2-tuple, (status, msg)."""
+    from SCons.Script import GetBuildFailures
+    bf = GetBuildFailures()
+    if bf:
+        # bf is normally a list of build failures; if an element is None,
+        # it's because of a target that scons doesn't know anything about.
+        status = 'failed'
+        failures_message = "\n".join(["Failed building %s" % bf_to_str(x)
+                           for x in bf if x is not None])
+    else:
+        # if bf is None, the build completed successfully.
+        status = 'ok'
+        failures_message = ''
+    return (status, failures_message)
 
-        def display_build_status():
-            """Display the build status.  Called by atexit.
-            Here you could do all kinds of complicated things."""
-            status, failures_message = build_status()
-            if status == 'failed':
-               print "FAILED!!!!"  # could display alert, ring bell, etc.
-            elif status == 'ok':
-               print "Build succeeded."
-            print failures_message
+def display_build_status():
+    """Display the build status.  Called by atexit.
+    Here you could do all kinds of complicated things."""
+    status, failures_message = build_status()
+    if status == 'failed':
+       print "FAILED!!!!"  # could display alert, ring bell, etc.
+    elif status == 'ok':
+       print "Build succeeded."
+    print failures_message
 
-        atexit.register(display_build_status)
+atexit.register(display_build_status)
       </file>
     </scons_example>
 

doc/user/scanners.xml

 
     <scons_example name="scanners_scan">
       <file name="SConstruct" printme="1">
-        import re
+  import re
 
-        include_re = re.compile(r'^include\s+(\S+)$', re.M)
+  include_re = re.compile(r'^include\s+(\S+)$', re.M)
 
-        def kfile_scan(node, env, path):
-            contents = node.get_text_contents()
-            includes = include_re.findall(contents)
-            return env.File(includes)
+  def kfile_scan(node, env, path):
+      contents = node.get_text_contents()
+      includes = include_re.findall(contents)
+      return env.File(includes)
 
-        kscan = Scanner(function = kfile_scan,
-                        skeys = ['.k'])
+  kscan = Scanner(function = kfile_scan,
+                  skeys = ['.k'])
 
-        env = Environment(ENV = {'PATH' : '__ROOT__/usr/local/bin'})
-        env.Append(SCANNERS = kscan)
+  env = Environment(ENV = {'PATH' : '__ROOT__/usr/local/bin'})
+  env.Append(SCANNERS = kscan)
 
-        env.Command('foo', 'foo.k', 'kprocess &lt; $SOURCES &gt; $TARGET')
+  env.Command('foo', 'foo.k', 'kprocess &lt; $SOURCES &gt; $TARGET')
       </file>
       <file name="foo.k">
-      include other_file
+include other_file
       </file>
       <file name="other_file">
-      other_file
+other_file
       </file>
       <directory name="__ROOT__/usr"></directory>
       <directory name="__ROOT__/usr/local"></directory>
       <directory name="__ROOT__/usr/local/bin"></directory>
       <file name="__ROOT_/usr/local/bin/kprocess" chmod="755">
-      cat
+cat
       </file>
     </scons_example>
 

doc/user/sconf.xml

     </para>
 
     <sconstruct>
-    mylib_test_source_file = """
-    #include &amp;lt;mylib.h&amp;gt;
-    int main(int argc, char **argv)
-    {
-        MyLibrary mylib(argc, argv);
-        return 0;
-    }
-    """
+mylib_test_source_file = """
+#include &amp;lt;mylib.h&amp;gt;
+int main(int argc, char **argv)
+{
+    MyLibrary mylib(argc, argv);
+    return 0;
+}
+"""
 
-    def CheckMyLibrary(context):
-        context.Message('Checking for MyLibrary...')
-        result = context.TryLink(mylib_test_source_file, '.c')
-        context.Result(result)
-        return result
+def CheckMyLibrary(context):
+    context.Message('Checking for MyLibrary...')
+    result = context.TryLink(mylib_test_source_file, '.c')
+    context.Result(result)
+    return result
     </sconstruct>
 
     <para>
     </para>
 
     <sconstruct>
-    mylib_test_source_file = """
-    #include &amp;lt;mylib.h&amp;gt;
-    int main(int argc, char **argv)
-    {
-        MyLibrary mylib(argc, argv);
-        return 0;
-    }
-    """
+mylib_test_source_file = """
+#include &amp;lt;mylib.h&amp;gt;
+int main(int argc, char **argv)
+{
+    MyLibrary mylib(argc, argv);
+    return 0;
+}
+"""
 
-    def CheckMyLibrary(context):
-        context.Message('Checking for MyLibrary... ')
-        result = context.TryLink(mylib_test_source_file, '.c')
-        context.Result(result)
-        return result
+def CheckMyLibrary(context):
+    context.Message('Checking for MyLibrary... ')
+    result = context.TryLink(mylib_test_source_file, '.c')
+    context.Result(result)
+    return result
 
-    env = Environment()
-    conf = Configure(env, custom_tests = {'CheckMyLibrary' : CheckMyLibrary})
-    if not conf.CheckMyLibrary():
-        print 'MyLibrary is not installed!'
-        Exit(1)
-    env = conf.Finish()
+env = Environment()
+conf = Configure(env, custom_tests = {'CheckMyLibrary' : CheckMyLibrary})
+if not conf.CheckMyLibrary():
+    print 'MyLibrary is not installed!'
+    Exit(1)
+env = conf.Finish()
 
-    # We would then add actual calls like Program() to build
-    # something using the "env" construction environment.
+# We would then add actual calls like Program() to build
+# something using the "env" construction environment.
     </sconstruct>
 
     <para>

doc/user/variants.xml

 
   <scons_example name="variants_ex">
     <file name="SConstruct" printme="1">
-    platform = ARGUMENTS.get('OS', Platform())
+platform = ARGUMENTS.get('OS', Platform())
 
-    include = "#export/$PLATFORM/include"
-    lib = "#export/$PLATFORM/lib"
-    bin = "#export/$PLATFORM/bin"
+include = "#export/$PLATFORM/include"
+lib = "#export/$PLATFORM/lib"
+bin = "#export/$PLATFORM/bin"
 
-    env = Environment(PLATFORM = platform,
-                      BINDIR = bin,
-                      INCDIR = include,
-                      LIBDIR = lib,
-                      CPPPATH = [include],
-                      LIBPATH = [lib],
-                      LIBS = 'world')
+env = Environment(PLATFORM = platform,
+                  BINDIR = bin,
+                  INCDIR = include,
+                  LIBDIR = lib,
+                  CPPPATH = [include],
+                  LIBPATH = [lib],
+                  LIBS = 'world')
 
-    Export('env')
+Export('env')
 
-    env.SConscript('src/SConscript', variant_dir='build/$PLATFORM')
+env.SConscript('src/SConscript', variant_dir='build/$PLATFORM')
     </file>
     <directory name="src"></directory>
     <directory name="src/hello"></directory>
     <directory name="src/world"></directory>
     <file name="src/SConscript">
-    Import('env')
-    SConscript('hello/SConscript')
-    SConscript('world/SConscript')
+Import('env')
+SConscript('hello/SConscript')
+SConscript('world/SConscript')
     </file>
     <file name="src/hello/SConscript">
-    Import('env')
-    hello = env.Program('hello.c')
-    env.Install('$BINDIR', hello)
+Import('env')
+hello = env.Program('hello.c')
+env.Install('$BINDIR', hello)
     </file>
     <file name="src/hello/hello.c">
-    #include "world.h"
-    int main(int argc, char *argv[]) { printf "hello.c\n"; world(); }
+#include "world.h"
+int main(int argc, char *argv[]) { printf "hello.c\n"; world(); }
     </file>
     <file name="src/world/SConscript">
-    Import('env')
-    world = env.Library('world.c')
-    env.Install('$LIBDIR', world)
-    env.Install('$INCDIR', 'world.h')
+Import('env')
+world = env.Library('world.c')
+env.Install('$LIBDIR', world)
+env.Install('$INCDIR', 'world.h')
     </file>
     <file name="src/world/world.h">
-    #define STRING "world.h"
-    extern int world();
+#define STRING "world.h"
+extern int world();
     </file>
     <file name="src/world/world.c">
-    int world() { printf "world.c\n"; }
+int world() { printf "world.c\n"; }
     </file>
   </scons_example>
 

src/engine/SCons/Tool/zip.xml

 
 <cvar name="ZIPROOT">
 <summary>
+<para>
 An optional zip root directory (default empty).  The filenames stored
 in the zip file will be relative to this directory, if given.
 Otherwise the filenames are relative to the current directory of the
 command.
 For instance:
+</para>
 <example_commands>
 env = Environment()
 env.Zip('foo.zip', 'subdir1/subdir2/file1', ZIPROOT='subdir1')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.