Fix many epydoc warnings
authorWilliam Deegan <bill@baddogconsulting.com>
Fri, 1 Sep 2017 02:57:51 +0000 (19:57 -0700)
committerWilliam Deegan <bill@baddogconsulting.com>
Fri, 1 Sep 2017 02:57:51 +0000 (19:57 -0700)
22 files changed:
src/engine/SCons/Action.py
src/engine/SCons/Builder.py
src/engine/SCons/Conftest.py
src/engine/SCons/Environment.py
src/engine/SCons/Errors.py
src/engine/SCons/Memoize.py
src/engine/SCons/Node/FS.py
src/engine/SCons/SConf.py
src/engine/SCons/Scanner/LaTeX.py
src/engine/SCons/Scanner/__init__.py
src/engine/SCons/Script/Interactive.py
src/engine/SCons/Taskmaster.py
src/engine/SCons/Util.py
src/engine/SCons/Variables/BoolVariable.py
src/engine/SCons/Variables/EnumVariable.py
src/engine/SCons/Variables/ListVariable.py
src/engine/SCons/Variables/PackageVariable.py
src/engine/SCons/Variables/PathVariable.py
src/engine/SCons/Variables/__init__.py
src/engine/SCons/cpp.py
src/engine/SCons/dblite.py
test/Interactive/help.py

index d6fe30b4f66c9f6bac39bf5b035600041409d385..b44088bfb3071d1421404482eb42e9a78676fec6 100644 (file)
@@ -222,9 +222,10 @@ def _code_contents(code, docstring=None):
     recompilations from moving a Python function.
 
     See:
-      * https://docs.python.org/2/library/inspect.html
-      * http://python-reference.readthedocs.io/en/latest/docs/code/index.html
-    For info on what each co_ variable provides
+      - https://docs.python.org/2/library/inspect.html
+      - http://python-reference.readthedocs.io/en/latest/docs/code/index.html
+
+    For info on what each co\_ variable provides
 
     The signature is as follows (should be byte/chars):
     co_argcount, len(co_varnames), len(co_cellvars), len(co_freevars),
@@ -281,8 +282,7 @@ def _code_contents(code, docstring=None):
 
 
 def _function_contents(func):
-    """Return the signature contents of a function.
-
+    """
     The signature is as follows (should be byte/chars):
     < _code_contents (see above) from func.__code__ >
     ,( comma separated _object_contents for function argument defaults)
@@ -290,10 +290,12 @@ def _function_contents(func):
 
 
     See also: https://docs.python.org/3/reference/datamodel.html
-    func.__code__     - The code object representing the compiled function body.
-    func.__defaults__ - A tuple containing default argument values for those arguments
-                        that have defaults, or None if no arguments have a default value
-    func.__closure__  - None or a tuple of cells that contain bindings for the function's free variables.
+      - func.__code__     - The code object representing the compiled function body.
+      - func.__defaults__ - A tuple containing default argument values for those arguments that have defaults, or None if no arguments have a default value
+      - func.__closure__  - None or a tuple of cells that contain bindings for the function's free variables.
+
+    :Returns:
+      Signature contents of a function. (in bytes)
     """
 
     contents = [_code_contents(func.__code__, func.__doc__)]
@@ -330,9 +332,12 @@ def _function_contents(func):
 def _object_instance_content(obj):
     """
     Returns consistant content for a action class or an instance thereof
-    :param obj: Should be either and action class or an instance thereof
-    :return: bytearray or bytes representing the obj suitable for generating
-             a signiture from.
+
+    :Parameters:
+      - `obj` Should be either and action class or an instance thereof
+
+    :Returns:
+      bytearray or bytes representing the obj suitable for generating a signature from.
     """
     retval = bytearray()
 
index 21f1b4ae7bcdd050088be9909b99a9befd8f027f..afc2cf0d1e4603428c4329e584bf8a98db03961b 100644 (file)
@@ -1,4 +1,5 @@
-"""SCons.Builder
+"""
+SCons.Builder
 
 Builder object subsystem.
 
@@ -31,7 +32,7 @@ There is also a proxy that looks like a Builder:
 Builders and their proxies have the following public interface methods
 used by other modules:
 
-    __call__()
+    __call__()
         THE public interface.  Calling a Builder object (with the
         use of internal helper methods) sets up the target and source
         dependencies, appropriate mapping to a specific action, and the
@@ -39,12 +40,12 @@ used by other modules:
         variable.  This also takes care of warning about possible mistakes
         in keyword arguments.
 
-    add_emitter()
+    add_emitter()
         Adds an emitter for a specific file suffix, used by some Tool
         modules to specify that (for example) a yacc invocation on a .y
         can create a .h *and* a .c file.
 
-    add_action()
+    add_action()
         Adds an action for a specific file suffix, heavily used by
         Tool modules to add their specific action(s) for turning
         a source file into an object file to the global static
@@ -52,23 +53,23 @@ used by other modules:
 
 There are the following methods for internal use within this module:
 
-    _execute()
+    _execute()
         The internal method that handles the heavily lifting when a
         Builder is called.  This is used so that the __call__() methods
         can set up warning about possible mistakes in keyword-argument
         overrides, and *then* execute all of the steps necessary so that
         the warnings only occur once.
 
-    get_name()
+    get_name()
         Returns the Builder's name within a specific Environment,
         primarily used to try to return helpful information in error
         messages.
 
-    adjust_suffix()
-    get_prefix()
-    get_suffix()
-    get_src_suffix()
-    set_src_suffix()
+    adjust_suffix()
+    get_prefix()
+    get_suffix()
+    get_src_suffix()
+    set_src_suffix()
         Miscellaneous stuff for handling the prefix and suffix
         manipulation we use in turning source file names into target
         file names.
index 4db7e0622fb6a886d7487f8570b7e656a4041498..abaf00d48f1ec21ab59eb33aeccea3c4fa404bf9 100644 (file)
@@ -706,11 +706,12 @@ def CheckProg(context, prog_name):
 def _YesNoResult(context, ret, key, text, comment = None):
     """
     Handle the result of a test with a "yes" or "no" result.
-    "ret" is the return value: empty if OK, error message when not.
-    "key" is the name of the symbol to be defined (HAVE_foo).
-    "text" is the source code of the program used for testing.
-    "comment" is the C comment to add above the line defining the symbol (the
-    comment is automatically put inside a /* */). If None, no comment is added.
+
+    :Parameters:
+      - `ret` is the return value: empty if OK, error message when not.
+      - `key` is the name of the symbol to be defined (HAVE_foo).
+      - `text` is the source code of the program used for testing.
+      - `comment` is the C comment to add above the line defining the symbol (the comment is automatically put inside a /\* \*/). If None, no comment is added.
     """
     if key:
         _Have(context, key, not ret, comment)
@@ -724,18 +725,20 @@ def _YesNoResult(context, ret, key, text, comment = None):
 def _Have(context, key, have, comment = None):
     """
     Store result of a test in context.havedict and context.headerfilename.
-    "key" is a "HAVE_abc" name.  It is turned into all CAPITALS and non-
-    alphanumerics are replaced by an underscore.
+
+    :Parameters:
+      - `key` - is a "HAVE_abc" name.  It is turned into all CAPITALS and non-alphanumerics are replaced by an underscore.
+      - `have`   - value as it should appear in the header file, include quotes when desired and escape special characters!
+      - `comment` is the C comment to add above the line defining the symbol (the comment is automatically put inside a /\* \*/). If None, no comment is added.
+
+
     The value of "have" can be:
-    1      - Feature is defined, add "#define key".
-    0      - Feature is not defined, add "/* #undef key */".
-             Adding "undef" is what autoconf does.  Not useful for the
-             compiler, but it shows that the test was done.
-    number - Feature is defined to this number "#define key have".
-             Doesn't work for 0 or 1, use a string then.
-    string - Feature is defined to this string "#define key have".
-             Give "have" as is should appear in the header file, include quotes
-             when desired and escape special characters!
+      - 1      - Feature is defined, add "#define key".
+      - 0      - Feature is not defined, add "/\* #undef key \*/". Adding "undef" is what autoconf does.  Not useful for the compiler, but it shows that the test was done.
+      - number - Feature is defined to this number "#define key have". Doesn't work for 0 or 1, use a string then.
+      - string - Feature is defined to this string "#define key have".
+
+
     """
     key_up = key.upper()
     key_up = re.sub('[^A-Z0-9_]', '_', key_up)
@@ -786,10 +789,11 @@ def _lang2suffix(lang):
     When "lang" is empty or None C is assumed.
     Returns a tuple (lang, suffix, None) when it works.
     For an unrecognized language returns (None, None, msg).
+
     Where:
-        lang   = the unified language name
-        suffix = the suffix, including the leading dot
-        msg    = an error message
+      - lang   = the unified language name
+      - suffix = the suffix, including the leading dot
+      - msg    = an error message
     """
     if not lang or lang in ["C", "c"]:
         return ("C", ".c", None)
index 6a127db5e11be6c4fe78710942280957238f91d7..42b28e616bfe35cc6de74776c922adee14f05a9c 100644 (file)
@@ -2189,13 +2189,16 @@ class Base(SubstitutionEnvironment):
         """This function converts a string or list into a list of strings
         or Nodes.  This makes things easier for users by allowing files to
         be specified as a white-space separated list to be split.
+
         The input rules are:
             - A single string containing names separated by spaces. These will be
               split apart at the spaces.
             - A single Node instance
             - A list containing either strings or Node instances. Any strings
               in the list are not split at spaces.
+
         In all cases, the function returns a list of Nodes and strings."""
+
         if SCons.Util.is_List(arg):
             return list(map(self.subst, arg))
         elif SCons.Util.is_String(arg):
index 1df8cb9144b7b16740ab18d89cbc51b6732e76d8..2ba007cc8c460face040f09da5a63c878839f902 100644 (file)
@@ -38,55 +38,55 @@ class BuildError(Exception):
     """ Errors occurring while building.
 
     BuildError have the following attributes:
+    =========================================
 
-        Information about the cause of the build error:
-        -----------------------------------------------
+    Information about the cause of the build error:
+    -----------------------------------------------
 
-        errstr : a description of the error message
+    errstr : a description of the error message
 
-        status : the return code of the action that caused the build
-                 error. Must be set to a non-zero value even if the
-                 build error is not due to an action returning a
-                 non-zero returned code.
+    status : the return code of the action that caused the build error.
+    Must be set to a non-zero value even if the build error is not due
+    to an action returning a non-zero returned code.
 
-        exitstatus : SCons exit status due to this build error.
-                     Must be nonzero unless due to an explicit Exit()
-                     call.  Not always the same as status, since
-                     actions return a status code that should be
-                     respected, but SCons typically exits with 2
-                     irrespective of the return value of the failed
-                     action.
+    exitstatus : SCons exit status due to this build error.
+    Must be nonzero unless due to an explicit Exit()
+    call.  Not always the same as status, since
+    actions return a status code that should be
+    respected, but SCons typically exits with 2
+    irrespective of the return value of the failed
+    action.
 
-        filename : The name of the file or directory that caused the
-                   build error. Set to None if no files are associated with
-                   this error. This might be different from the target
-                   being built. For example, failure to create the
-                   directory in which the target file will appear. It
-                   can be None if the error is not due to a particular
-                   filename.
+    filename : The name of the file or directory that caused the
+    build error. Set to None if no files are associated with
+    this error. This might be different from the target
+    being built. For example, failure to create the
+    directory in which the target file will appear. It
+    can be None if the error is not due to a particular
+    filename.
 
-        exc_info : Info about exception that caused the build
-                   error. Set to (None, None, None) if this build
-                   error is not due to an exception.
+    exc_info : Info about exception that caused the build
+    error. Set to (None, None, None) if this build
+    error is not due to an exception.
 
 
-        Information about the cause of the location of the error:
-        ---------------------------------------------------------
+    Information about the cause of the location of the error:
+    ---------------------------------------------------------
 
-        node : the error occured while building this target node(s)
-        
-        executor : the executor that caused the build to fail (might
-                   be None if the build failures is not due to the
-                   executor failing)
-        
-        action : the action that caused the build to fail (might be
-                 None if the build failures is not due to the an
-                 action failure)
+    node : the error occured while building this target node(s)
 
-        command : the command line for the action that caused the
-                  build to fail (might be None if the build failures
-                  is not due to the an action failure)
-        """
+    executor : the executor that caused the build to fail (might
+               be None if the build failures is not due to the
+               executor failing)
+
+    action : the action that caused the build to fail (might be
+             None if the build failures is not due to the an
+             action failure)
+
+    command : the command line for the action that caused the
+              build to fail (might be None if the build failures
+              is not due to the an action failure)
+    """
 
     def __init__(self,
                  node=None, errstr="Unknown error", status=2, exitstatus=2,
@@ -94,7 +94,6 @@ class BuildError(Exception):
                  exc_info=(None, None, None)):
 
         # py3: errstr should be string and not bytes.
-        # import pdb; pdb.set_trace()
 
         self.errstr = SCons.Util.to_str(errstr)
         self.status = status
@@ -142,13 +141,13 @@ def convert_to_BuildError(status, exc_info=None):
     """
     Convert any return code a BuildError Exception.
 
-    `status' can either be a return code or an Exception.
+    :Parameters:
+      - `status`: can either be a return code or an Exception.
+
     The buildError.status we set here will normally be
     used as the exit status of the "scons" process.
     """
 
-    # import pdb; pdb.set_trace()
-
     if not exc_info and isinstance(status, Exception):
         exc_info = (status.__class__, status, None)
 
index 9774bdd3995ed993430225eb088f80d51c4fe789..5bdcf42b2090d9a94a89334dbbf2449bc2d4324c 100644 (file)
@@ -34,7 +34,7 @@ values in a consistent way. In particular, it requires that the class uses a
 dictionary named "_memo" to store the cached values.
 
 Here is an example of wrapping a method that returns a computed value,
-with no input parameters:
+with no input parameters::
 
     @SCons.Memoize.CountMethodCall
     def foo(self):
@@ -51,7 +51,7 @@ with no input parameters:
         return result
 
 Here is an example of wrapping a method that will return different values
-based on one or more input arguments:
+based on one or more input arguments::
 
     def _bar_key(self, argument):                               # Memoization
         return argument                                         # Memoization
index c31ac6c43ead5ad392a5fbe0746d4537d0205bda..684f0d116eacf347e363d85ca4e46fc26fc72e15 100644 (file)
@@ -559,14 +559,13 @@ class Base(SCons.Node.Node):
         our relative and absolute paths, identify our parent
         directory, and indicate that this node should use
         signatures."""
+
         if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.Base')
         SCons.Node.Node.__init__(self)
 
-        # Filenames and paths are probably reused and are intern'ed to
-        # save some memory.
-
-        #: Filename with extension as it was specified when the object was
-        #: created; to obtain filesystem path, use Python str() function
+        # Filenames and paths are probably reused and are intern'ed to save some memory.
+        # Filename with extension as it was specified when the object was
+        # created; to obtain filesystem path, use Python str() function
         self.name = SCons.Util.silent_intern(name)
         self.fs = fs #: Reference to parent Node.FS object
 
@@ -2255,8 +2254,8 @@ class RootDir(Dir):
             name = drive
             dirname = drive + OS_SEP
 
-        #: Filename with extension as it was specified when the object was
-        #: created; to obtain filesystem path, use Python str() function
+        # Filename with extension as it was specified when the object was
+        # created; to obtain filesystem path, use Python str() function
         self.name = SCons.Util.silent_intern(name)
         self.fs = fs #: Reference to parent Node.FS object
 
@@ -2959,7 +2958,7 @@ class File(Base):
          We'd like to remove a lot more attributes like self.sources
          and self.sources_set, but they might get used
          in a next build step. For example, during configuration
-         the source files for a built *.o file are used to figure out
+         the source files for a built E{*}.o file are used to figure out
          which linker to use for the resulting Program (gcc vs. g++)!
          That's why we check for the 'keep_targetinfo' attribute,
          config Nodes and the Interactive mode just don't allow
@@ -3448,20 +3447,15 @@ class FileFinder(object):
     @SCons.Memoize.CountDictCall(_find_file_key)
     def find_file(self, filename, paths, verbose=None):
         """
-        find_file(str, [Dir()]) -> [nodes]
+        Find a node corresponding to either a derived file or a file that exists already.
 
-        filename - a filename to find
-        paths - a list of directory path *nodes* to search in.  Can be
-                represented as a list, a tuple, or a callable that is
-                called with no arguments and returns the list or tuple.
+        Only the first file found is returned, and none is returned if no file is found.
 
-        returns - the node created from the found file.
+        filename: A filename to find
+        paths: A list of directory path *nodes* to search in.  Can be represented as a list, a tuple, or a callable that is called with no arguments and returns the list or tuple.
 
-        Find a node corresponding to either a derived file or a file
-        that exists already.
+        returns The node created from the found file.
 
-        Only the first file found is returned, and none is returned
-        if no file is found.
         """
         memo_key = self._find_file_key(filename, paths)
         try:
index 889af4a0b548af78aee7258336f8e05bc7ece00c..48eed8ee77fa58633967afc2c90ae022065e6ce2 100644 (file)
@@ -459,9 +459,9 @@ class SConfBase(object):
         If value is None (default), then #define name is written. If value is not
         none, then #define name value is written.
 
-        comment is a string which will be put as a C comment in the
-        header, to explain the meaning of the value (appropriate C comments /* and
-        */ will be put automatically."""
+        comment is a string which will be put as a C comment in the header, to explain the meaning of the value
+        (appropriate C comments will be added automatically).
+        """
         lines = []
         if comment:
             comment_str = "/* %s */" % comment
index e5abb0c2d3f5379d4db123a8d7c14a868cbd97a8..5800443aef9289ad66bbb695a390dd5c43f53d65 100644 (file)
@@ -78,8 +78,10 @@ def modify_env_var(env, var, abspath):
     return save
 
 class FindENVPathDirs(object):
-    """A class to bind a specific *PATH variable name to a function that
-    will return all of the *path directories."""
+    """
+    A class to bind a specific E{*}PATH variable name to a function that
+    will return all of the E{*}path directories.
+    """
     def __init__(self, variable):
         self.variable = variable
     def __call__(self, env, dir=None, target=None, source=None, argument=None):
@@ -96,7 +98,8 @@ class FindENVPathDirs(object):
 
 
 def LaTeXScanner():
-    """Return a prototype Scanner instance for scanning LaTeX source files
+    """
+    Return a prototype Scanner instance for scanning LaTeX source files
     when built with latex.
     """
     ds = LaTeX(name = "LaTeXScanner",
@@ -107,7 +110,8 @@ def LaTeXScanner():
     return ds
 
 def PDFLaTeXScanner():
-    """Return a prototype Scanner instance for scanning LaTeX source files
+    """
+    Return a prototype Scanner instance for scanning LaTeX source files
     when built with pdflatex.
     """
     ds = LaTeX(name = "PDFLaTeXScanner",
@@ -118,7 +122,8 @@ def PDFLaTeXScanner():
     return ds
 
 class LaTeX(SCons.Scanner.Base):
-    """Class for scanning LaTeX files for included files.
+    """
+    Class for scanning LaTeX files for included files.
 
     Unlike most scanners, which use regular expressions that just
     return the included file name, this returns a tuple consisting
@@ -135,10 +140,12 @@ class LaTeX(SCons.Scanner.Base):
     
     The actual subset and search order may be altered by
     DeclareGraphicsExtensions command. This complication is ignored.
-    The default order corresponds to experimentation with teTeX
+    The default order corresponds to experimentation with teTeX::
+
         $ latex --version
         pdfeTeX 3.141592-1.21a-2.2 (Web2C 7.5.4)
         kpathsea version 3.5.4
+
     The order is:
         ['.eps', '.ps'] for latex
         ['.png', '.pdf', '.jpg', '.tif'].
@@ -150,8 +157,7 @@ class LaTeX(SCons.Scanner.Base):
     env['TEXINPUTS'] for "lstinputlisting" keyword
     env['BIBINPUTS'] for "bibliography" keyword
     env['BSTINPUTS'] for "bibliographystyle" keyword
-    env['INDEXSTYLE'] for "makeindex" keyword, no scanning support needed
-                      just allows user to set it if needed.
+    env['INDEXSTYLE'] for "makeindex" keyword, no scanning support needed just allows user to set it if needed.
 
     FIXME: also look for the class or style in document[class|style]{}
     FIXME: also look for the argument of bibliographystyle{}
index c0f1a933a61494813e4f231806c1f633e2de6af1..f7828abe42b304ba9709442e710c63b5e91a829a 100644 (file)
@@ -62,8 +62,10 @@ def Scanner(function, *args, **kw):
 
 
 class FindPathDirs(object):
-    """A class to bind a specific *PATH variable name to a function that
-    will return all of the *path directories."""
+    """
+    A class to bind a specific E{*}PATH variable name to a function that
+    will return all of the E{*}path directories.
+    """
     def __init__(self, variable):
         self.variable = variable
     def __call__(self, env, dir=None, target=None, source=None, argument=None):
index 6be7b2701c3d8df1f580e162283f59e943de0003..cc4f23cfd223895eb55ebb8066bbc1bc930c563a 100644 (file)
@@ -99,17 +99,14 @@ except ImportError:
 
 class SConsInteractiveCmd(cmd.Cmd):
     """\
-    build [TARGETS]         Build the specified TARGETS and their dependencies.
-                            'b' is a synonym.
-    clean [TARGETS]         Clean (remove) the specified TARGETS and their
-                            dependencies.  'c' is a synonym.
-    exit                    Exit SCons interactive mode.
-    help [COMMAND]          Prints help for the specified COMMAND.  'h' and
-                            '?' are synonyms.
-    shell [COMMANDLINE]     Execute COMMANDLINE in a subshell.  'sh' and '!'
-                            are synonyms.
-    version                 Prints SCons version information.
-    """
+
+build [TARGETS]         Build the specified TARGETS and their dependencies. 'b' is a synonym.
+clean [TARGETS]         Clean (remove) the specified TARGETS and their dependencies.  'c' is a synonym.
+exit                    Exit SCons interactive mode.
+help [COMMAND]          Prints help for the specified COMMAND.  'h' and '?' are synonyms.
+shell [COMMANDLINE]     Execute COMMANDLINE in a subshell.  'sh' and '!' are synonyms.
+version                 Prints SCons version information.
+"""
 
     synonyms = {
         'b'     : 'build',
index 9bd959751439af37491588d08996144792bef5d5..17507a6ff15381980db220590cbaa990efebc809 100644 (file)
@@ -25,16 +25,19 @@ from __future__ import print_function
 import sys
 
 __doc__ = """
-Generic Taskmaster module for the SCons build engine.
-
-This module contains the primary interface(s) between a wrapping user
-interface and the SCons build engine.  There are two key classes here:
-
+    Generic Taskmaster module for the SCons build engine.
+    =====================================================
+    
+    This module contains the primary interface(s) between a wrapping user
+    interface and the SCons build engine.  There are two key classes here:
+    
     Taskmaster
+    ----------
         This is the main engine for walking the dependency graph and
         calling things to decide what does or doesn't need to be built.
 
     Task
+    ----
         This is the base class for allowing a wrapping interface to
         decide what does or doesn't actually need to be done.  The
         intention is for a wrapping interface to subclass this as
@@ -42,7 +45,7 @@ interface and the SCons build engine.  There are two key classes here:
 
         The canonical example is the SCons native Python interface,
         which has Task subclasses that handle its specific behavior,
-        like printing "`foo' is up to date" when a top-level target
+        like printing "'foo' is up to date" when a top-level target
         doesn't need to be built, and handling the -c option by removing
         targets as its "build" action.  There is also a separate subclass
         for suppressing this output when the -q option is used.
@@ -689,14 +692,14 @@ class Taskmaster(object):
         at node A. The Taskmaster first considers whether node A's
         child B is up-to-date. Then, recursively, node B needs to
         check whether node C is up-to-date. This leaves us with a
-        dependency graph looking like:
+        dependency graph looking like::
 
-                                      Next candidate \
-                                                      \
-        Node A (Pending) --> Node B(Pending) --> Node C (NoState)
-                ^                                     |
-                |                                     |
-                +-------------------------------------+
+                                          Next candidate \
+                                                          \
+            Node A (Pending) --> Node B(Pending) --> Node C (NoState)
+                    ^                                     |
+                    |                                     |
+                    +-------------------------------------+
 
         Now, when the Taskmaster examines the Node C's child Node A,
         it finds that Node A is in the "pending" state. Therefore,
@@ -705,15 +708,14 @@ class Taskmaster(object):
         Pending children indicate that the Taskmaster has potentially
         loop back through a cycle. We say potentially because it could
         also occur when a DAG is evaluated in parallel. For example,
-        consider the following graph:
-
-
-        Node A (Pending) --> Node B(Pending) --> Node C (Pending) --> ...
-                |                                     ^
-                |                                     |
-                +----------> Node D (NoState) --------+
-                                  /
-                  Next candidate /
+        consider the following graph::
+
+            Node A (Pending) --> Node B(Pending) --> Node C (Pending) --> ...
+                    |                                     ^
+                    |                                     |
+                    +----------> Node D (NoState) --------+
+                                      /
+                      Next candidate /
 
         The Taskmaster first evaluates the nodes A, B, and C and
         starts building some children of node C. Assuming, that the
index 846d06c9c0bfb09b56342e1895ef59dbec4eaae0..f47839911fee856bd14dd9736ac86e4bfb98a19e 100644 (file)
@@ -231,16 +231,17 @@ class DisplayEngine(object):
     def set_mode(self, mode):
         self.print_it = mode
 
+
 def render_tree(root, child_func, prune=0, margin=[0], visited=None):
     """
     Render a tree of nodes into an ASCII tree view.
-    root - the root node of the tree
-    child_func - the function called to get the children of a node
-    prune - don't visit the same node twice
-    margin - the format of the left margin to use for children of root.
-       1 results in a pipe, and 0 results in no pipe.
-    visited - a dictionary of visited nodes in the current branch if not prune,
-       or in the whole tree if prune.
+
+    :Parameters:
+        - `root`:       the root node of the tree
+        - `child_func`: the function called to get the children of a node
+        - `prune`:      don't visit the same node twice
+        - `margin`:     the format of the left margin to use for children of root. 1 results in a pipe, and 0 results in no pipe.
+        - `visited`:    a dictionary of visited nodes in the current branch if not prune, or in the whole tree if prune.
     """
 
     rname = str(root)
@@ -281,14 +282,13 @@ def print_tree(root, child_func, prune=0, showtags=0, margin=[0], visited=None):
     lines directly instead of creating a string representation in memory,
     so that huge trees can be printed.
 
-    root - the root node of the tree
-    child_func - the function called to get the children of a node
-    prune - don't visit the same node twice
-    showtags - print status information to the left of each node line
-    margin - the format of the left margin to use for children of root.
-       1 results in a pipe, and 0 results in no pipe.
-    visited - a dictionary of visited nodes in the current branch if not prune,
-       or in the whole tree if prune.
+    :Parameters:
+        - `root`       - the root node of the tree
+        - `child_func` - the function called to get the children of a node
+        - `prune`      - don't visit the same node twice
+        - `showtags`   - print status information to the left of each node line
+        - `margin`     - the format of the left margin to use for children of root. 1 results in a pipe, and 0 results in no pipe.
+        - `visited`    - a dictionary of visited nodes in the current branch if not prune, or in the whole tree if prune.
     """
 
     rname = str(root)
@@ -1454,19 +1454,20 @@ def make_path_relative(path):
 
 def AddMethod(obj, function, name=None):
     """
-    Adds either a bound method to an instance or the function itself
-    (or an unbound method in Python 2) to a class.
+    Adds either a bound method to an instance or the function itself (or an unbound method in Python 2) to a class.
     If name is ommited the name of the specified function
     is used by default.
-    Example:
-      a = A()
-      def f(self, x, y):
+
+    Example::
+
+        a = A()
+        def f(self, x, y):
         self.z = x + y
-      AddMethod(f, A, "add")
-      a.add(2, 4)
-      print(a.z)
-      AddMethod(lambda self, i: self.l[i], a, "listIndex")
-      print(a.listIndex(5))
+        AddMethod(f, A, "add")
+        a.add(2, 4)
+        print(a.z)
+        AddMethod(lambda self, i: self.l[i], a, "listIndex")
+        print(a.listIndex(5))
     """
     if name is None:
         name = function.__name__
index c005a62d438aaa222e9ec6c187a9e9c88eec4c8c..ce46eda3eb5f8e01bf5578f21ea112ab250fd9f3 100644 (file)
@@ -2,12 +2,12 @@
 
 This file defines the option type for SCons implementing true/false values.
 
-Usage example:
+Usage example::
 
-  opts = Variables()
-  opts.Add(BoolVariable('embedded', 'build for an embedded system', 0))
-  ...
-  if env['embedded'] == 1:
+    opts = Variables()
+    opts.Add(BoolVariable('embedded', 'build for an embedded system', 0))
+    ...
+    if env['embedded'] == 1:
     ...
 """
 
index 9448ba9a9bdcdb0b547f7c1987e98232d75f2a51..a9fb10001ffbd4cb1456a4e354c48d278f53981f 100644 (file)
@@ -3,14 +3,14 @@
 This file defines the option type for SCons allowing only specified
 input-values.
 
-Usage example:
+Usage example::
 
-  opts = Variables()
-  opts.Add(EnumVariable('debug', 'debug output and symbols', 'no',
+    opts = Variables()
+    opts.Add(EnumVariable('debug', 'debug output and symbols', 'no',
                       allowed_values=('yes', 'no', 'full'),
                       map={}, ignorecase=2))
-  ...
-  if env['debug'] == 'full':
+    ...
+    if env['debug'] == 'full':
     ...
 """
 
@@ -69,16 +69,14 @@ def EnumVariable(key, help, default, allowed_values, map={}, ignorecase=0):
 
     'ignorecase' defines the behaviour of the validator:
 
-    If ignorecase == 0, the validator/converter are case-sensitive.
-    If ignorecase == 1, the validator/converter are case-insensitive.
-    If ignorecase == 2, the validator/converter is case-insensitive and
-                        the converted value will always be lower-case.
+        If ignorecase == 0, the validator/converter are case-sensitive.
+        If ignorecase == 1, the validator/converter are case-insensitive.
+        If ignorecase == 2, the validator/converter is case-insensitive and the converted value will always be lower-case.
 
-    The 'validator' tests whether the value is in the list of allowed
-    values. The 'converter' converts input values according to the
-    given 'map'-dictionary (unmapped input values are returned
-    unchanged). 
+    The 'validator' tests whether the value is in the list of allowed values. The 'converter' converts input values
+    according to the given 'map'-dictionary (unmapped input values are returned unchanged).
     """
+
     help = '%s (%s)' % (help, '|'.join(allowed_values))
     # define validator
     if ignorecase >= 1:
index f2fdc18f0aed44fe703f434d84eaf3d6d186d50b..9024867682dddec1b36d508ffb0f886e4179cde2 100644 (file)
@@ -7,17 +7,17 @@ separated by comma. After the option has been processed, the option
 value holds either the named list elements, all list elements or no
 list elements at all.
 
-Usage example:
+Usage example::
 
-  list_of_libs = Split('x11 gl qt ical')
+    list_of_libs = Split('x11 gl qt ical')
 
-  opts = Variables()
-  opts.Add(ListVariable('shared',
+    opts = Variables()
+    opts.Add(ListVariable('shared',
                       'libraries to build as shared libraries',
                       'all',
                       elems = list_of_libs))
-  ...
-  for lib in list_of_libs:
+    ...
+    for lib in list_of_libs:
      if lib in env['shared']:
          env.SharedObject(...)
      else:
index 4ab085678a2ef7a486f23bf8efe297bf9eeab41f..a0ace2537bd998abb7c4075f70593060c4f15038 100644 (file)
@@ -13,18 +13,18 @@ Usage example:
       x11=yes  (will search for the package installation dir)
       x11=/usr/local/X11 (will check this path for existence)
 
-  To replace autoconf's --with-xxx=yyy 
-
-  opts = Variables()
-  opts.Add(PackageVariable('x11',
-                         'use X11 installed here (yes = search some places',
-                         'yes'))
-  ...
-  if env['x11'] == True:
-      dir = ... search X11 in some standard places ...
-      env['x11'] = dir 
-  if env['x11']:
-      ... build with x11 ...
+  To replace autoconf's --with-xxx=yyy ::
+
+      opts = Variables()
+      opts.Add(PackageVariable('x11',
+                             'use X11 installed here (yes = search some places',
+                             'yes'))
+      ...
+      if env['x11'] == True:
+          dir = ... search X11 in some standard places ...
+          env['x11'] = dir
+      if env['x11']:
+          ... build with x11 ...
 """
 
 #
index e615a5315717927a8f3c4c21dfc7cd8470bc963c..0ffcbc535ec8410b9f597ccec3c58513f12f0143 100644 (file)
@@ -8,8 +8,7 @@ Arguments to PathVariable are:
   option-name  = name of this option on the command line (e.g. "prefix")
   option-help  = help string for option
   option-dflt  = default value for this option
-  validator    = [optional] validator for option value.  Predefined
-                 validators are:
+  validator    = [optional] validator for option value.  Predefined validators are:
 
                      PathAccept -- accepts any path setting; no validation
                      PathIsDir  -- path must be an existing directory
@@ -25,7 +24,7 @@ Arguments to PathVariable are:
                  and the env is the env to which the Options have been
                  added.
 
-Usage example:
+Usage example::
 
   Examples:
       prefix=/usr/local
@@ -34,8 +33,8 @@ Usage example:
 
   opts = Variables()
   opts.Add(PathVariable('qtdir',
-                      'where the root of Qt is installed',
-                      qtdir, PathIsDir))
+                        'where the root of Qt is installed',
+                        qtdir, PathIsDir))
   opts.Add(PathVariable('qt_includes',
                       'where the Qt includes are installed',
                       '$qtdir/includes', PathIsDirCreate))
index 1fe44351405ee7ce490eba3b6b9de98240998d14..5b20b300a904c77eeadef78e23a0034e722f2eef 100644 (file)
@@ -115,13 +115,13 @@ class Variables(object):
         """
         Add an option.
 
-        key - the name of the variable, or a list or tuple of arguments
-        help - optional help text for the options
-        default - optional default value
-        validator - optional function that is called to validate the option's value
-                    Called with (key, value, environment)
-        converter - optional function that is called to convert the option's value before
-                    putting it in the environment.
+
+        @param key: the name of the variable, or a list or tuple of arguments
+        @param help: optional help text for the options
+        @param default: optional default value
+        @param validator: optional function that is called to validate the option's value
+        @type validator: Called with (key, value, environment)
+        @param converter: optional function that is called to convert the option's value before putting it in the environment.
         """
 
         if SCons.Util.is_List(key) or isinstance(key, tuple):
@@ -141,14 +141,17 @@ class Variables(object):
         Each list element is a tuple/list of arguments to be passed on
         to the underlying method for adding options.
 
-        Example:
-          opt.AddVariables(
+        Example::
+
+            opt.AddVariables(
             ('debug', '', 0),
             ('CC', 'The C compiler'),
             ('VALIDATE', 'An option for testing validation', 'notset',
              validator, None),
             )
+
         """
+
         for o in optlist:
             self._do_add(*o)
 
index 2e20017d5ba2cfbaedee34d2ba6239f36b1e6a65..161f070aecc730a5fcab32cddd4d1ab6513cdbe5 100644 (file)
@@ -26,7 +26,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 __doc__ = """
 SCons C Pre-Processor module
 """
-#TODO 2.3 and before has no sorted()
 import SCons.compat
 
 import os
@@ -543,9 +542,11 @@ class PreProcessor(object):
 
         This handles recursive expansion of values without "" or <>
         surrounding the name until an initial " or < is found, to handle
+
                 #include FILE
-        where FILE is a #define somewhere else.
-        """
+
+        where FILE is a #define somewhere else."""
+
         s = t[1]
         while not s[0] in '<"':
             #print("s =", s)
index 4ef2222d51bf1937ec398e7ad374d22d8aac1ebc..12b4f766992a3e453ded9a3589f0c8f46b37b86b 100644 (file)
@@ -40,8 +40,8 @@ except NameError:
 dblite_suffix = '.dblite'
 
 # TODO: Does commenting this out break switching from py2/3?
-if bytes is not str:
-    dblite_suffix += '.p3'
+if bytes is not str:
+    dblite_suffix += '.p3'
 tmp_suffix = '.tmp'
 
 
index 6020bdecfb29088a8161a3464a225b7b37047ba0..869876f13ea5fe6bcba3cc65f0a49760433f3df6 100644 (file)
@@ -57,15 +57,12 @@ scons.send('h\n')
 scons.send('?\n')
 
 help_text = """\
-build [TARGETS]         Build the specified TARGETS and their dependencies.
-                        'b' is a synonym.
-clean [TARGETS]         Clean (remove) the specified TARGETS and their
-                        dependencies.  'c' is a synonym.
+
+build [TARGETS]         Build the specified TARGETS and their dependencies. 'b' is a synonym.
+clean [TARGETS]         Clean (remove) the specified TARGETS and their dependencies.  'c' is a synonym.
 exit                    Exit SCons interactive mode.
-help [COMMAND]          Prints help for the specified COMMAND.  'h' and
-                        '?' are synonyms.
-shell [COMMANDLINE]     Execute COMMANDLINE in a subshell.  'sh' and '!'
-                        are synonyms.
+help [COMMAND]          Prints help for the specified COMMAND.  'h' and '?' are synonyms.
+shell [COMMANDLINE]     Execute COMMANDLINE in a subshell.  'sh' and '!' are synonyms.
 version                 Prints SCons version information.
 """