Skip to content

Commit 261f1d1

Browse files
committed
sphinx build: move docstring changes to own PR [ci skip]
Split this patchset so it contains only the Sphinx-build configuration itself, and not any docstring changes suggested by running Sphinx. Signed-off-by: Mats Wichmann <[email protected]>
1 parent be613a4 commit 261f1d1

File tree

11 files changed

+89
-126
lines changed

11 files changed

+89
-126
lines changed

SCons/Environment.py

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,16 +1502,11 @@ def Detect(self, progs):
15021502
def Dictionary(self, *args):
15031503
"""Return construction variables from an environment.
15041504
1505-
Args:
1506-
args: (optional) variable names to look up
1507-
1508-
Returns:
1509-
if args omitted, the dictionary of all consvars.
1510-
If one arg, the corresponding value is returned.
1511-
If more than one arg, a list of values is returned.
1512-
1513-
Raises:
1514-
KeyError: if any of args is not in the construction env.
1505+
:param *args: (optional) variable names to look up
1506+
:returns: if args omitted, the dictionary of all constr. vars.
1507+
If one arg, the corresponding value is returned.
1508+
If more than one arg, a list of values is returned.
1509+
:raises KeyError: if any of *args is not in the construction env.
15151510
15161511
"""
15171512
if not args:
@@ -1525,13 +1520,12 @@ def Dictionary(self, *args):
15251520
def Dump(self, key=None, format='pretty'):
15261521
""" Serialize the construction variables to a string.
15271522
1528-
Args:
1529-
key: if None, format the whole dict of variables.
1530-
Else format just the value for key (Default value = None)
1531-
format: specify the format of the variables to be serialized:
1523+
:param key: if None, format the whole dict of variables.
1524+
Else look up and format just the value for key.
1525+
1526+
:param format: specify the format of the variables to be serialized:
15321527
- pretty: pretty-printed string.
15331528
- json: JSON-formatted string.
1534-
(Default value = None)
15351529
15361530
"""
15371531
if key:
@@ -1562,15 +1556,12 @@ def non_serializable(obj):
15621556

15631557

15641558
def FindIxes(self, paths, prefix, suffix):
1565-
"""Search a list of paths for something that matches the prefix and suffix.
1566-
1567-
Args:
1568-
paths: the list of paths or nodes.
1569-
prefix: construction variable for the prefix.
1570-
suffix: construction variable for the suffix.
1571-
1572-
Returns: the matched path or None
1559+
"""
1560+
Search a list of paths for something that matches the prefix and suffix.
15731561
1562+
paths - the list of paths or nodes.
1563+
prefix - construction variable for the prefix.
1564+
suffix - construction variable for the suffix.
15741565
"""
15751566

15761567
suffix = self.subst('$'+suffix)
@@ -2026,7 +2017,7 @@ def Command(self, target, source, action, **kw):
20262017
pass
20272018
else:
20282019
del kw['target_factory']
2029-
2020+
20302021
bld = SCons.Builder.Builder(**bkw)
20312022
return bld(self, target, source, **kw)
20322023

SCons/Errors.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@
3535

3636

3737
class BuildError(Exception):
38-
"""SCons Errors that can occur while building.
38+
""" Errors occurring while building.
3939
40-
BuildError has the following attributes:
40+
BuildError have the following attributes:
41+
=========================================
4142
4243
Information about the cause of the build error:
44+
-----------------------------------------------
4345
4446
errstr : a description of the error message
4547
@@ -69,6 +71,7 @@ class BuildError(Exception):
6971
7072
7173
Information about the cause of the location of the error:
74+
---------------------------------------------------------
7275
7376
node : the error occured while building this target node(s)
7477

SCons/Platform/__init__.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@
5656

5757

5858
def platform_default():
59-
r"""Return the platform string for our execution environment.
59+
"""Return the platform string for our execution environment.
6060
6161
The returned value should map to one of the SCons/Platform/*.py
62-
files. Since scons is architecture independent, though, we don't
62+
files. Since we're architecture independent, though, we don't
6363
care about the machine architecture.
6464
"""
6565
osname = os.name
@@ -131,30 +131,26 @@ def __str__(self):
131131

132132

133133
class TempFileMunge:
134-
"""A callable class to enable temp files for long command lines.
135-
136-
You can set an Environment variable to this,
134+
"""A callable class. You can set an Environment variable to this,
137135
then call it with a string argument, then it will perform temporary
138136
file substitution on it. This is used to circumvent the long command
139-
line limitation. Example::
137+
line limitation.
140138
139+
Example usage:
141140
env["TEMPFILE"] = TempFileMunge
142141
env["LINKCOM"] = "${TEMPFILE('$LINK $TARGET $SOURCES','$LINKCOMSTR')}"
143142
144143
By default, the name of the temporary file used begins with a
145144
prefix of '@'. This may be configured for other tool chains by
146-
setting '$TEMPFILEPREFIX'. Example::
147-
145+
setting '$TEMPFILEPREFIX':
148146
env["TEMPFILEPREFIX"] = '-@' # diab compiler
149147
env["TEMPFILEPREFIX"] = '-via' # arm tool chain
150148
env["TEMPFILEPREFIX"] = '' # (the empty string) PC Lint
151149
152150
You can configure the extension of the temporary file through the
153151
TEMPFILESUFFIX variable, which defaults to '.lnk' (see comments
154-
in the code below). Example::
155-
152+
in the code below):
156153
env["TEMPFILESUFFIX"] = '.lnt' # PC Lint
157-
158154
"""
159155
def __init__(self, cmd, cmdstr = None):
160156
self.cmd = cmd

SCons/Script/SConsOptions.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,17 +346,15 @@ def reparse_local_options(self):
346346
Else, this would lead to problems in add_local_option()
347347
below. When called from there, we try to reparse the
348348
command-line arguments that
349-
350-
1. haven't been processed so far (self.largs), but
351-
2. are possibly not added to the list of options yet.
349+
1. haven't been processed so far (self.largs), but
350+
2. are possibly not added to the list of options yet.
352351
353352
So, when we only have a value for "--myargument" yet,
354353
a command-line argument of "--myarg=test" would set it.
355354
Responsible for this behaviour is the method
356355
_match_long_opt(), which allows for partial matches of
357356
the option name, as long as the common prefix appears to
358357
be unique.
359-
360358
This would lead to further confusion, because we might want
361359
to add another option "--myarg" later on (see issue #2929).
362360

SCons/Tool/dmd.py

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,22 @@
1010
2010-02-07 onwards
1111
1212
Compiler variables:
13-
14-
DC
15-
The name of the D compiler to use. Defaults to dmd or gdmd, whichever is found.
16-
DPATH
17-
List of paths to search for import modules.
18-
DVERSIONS
19-
List of version tags to enable when compiling.
20-
DDEBUG
21-
List of debug tags to enable when compiling.
13+
DC - The name of the D compiler to use. Defaults to dmd or gdmd,
14+
whichever is found.
15+
DPATH - List of paths to search for import modules.
16+
DVERSIONS - List of version tags to enable when compiling.
17+
DDEBUG - List of debug tags to enable when compiling.
2218
2319
Linker related variables:
24-
25-
LIBS
26-
List of library files to link in.
27-
DLINK
28-
Name of the linker to use. Defaults to dmd or gdmd, whichever is found.
29-
DLINKFLAGS
30-
List of linker flags.
20+
LIBS - List of library files to link in.
21+
DLINK - Name of the linker to use. Defaults to dmd or gdmd,
22+
whichever is found.
23+
DLINKFLAGS - List of linker flags.
3124
3225
Lib tool variables:
33-
34-
DLIB
35-
Name of the lib tool to use. Defaults to lib.
36-
DLIBFLAGS
37-
List of flags to pass to the lib tool.
38-
LIBS
39-
Same as for the linker. (libraries to pull into the .lib)
26+
DLIB - Name of the lib tool to use. Defaults to lib.
27+
DLIBFLAGS - List of flags to pass to the lib tool.
28+
LIBS - Same as for the linker. (libraries to pull into the .lib)
4029
"""
4130

4231
#

SCons/Tool/intelc.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -387,13 +387,13 @@ def find_in_2016style_dir(version):
387387
def generate(env, version=None, abi=None, topdir=None, verbose=0):
388388
r"""Add Builders and construction variables for Intel C/C++ compiler
389389
to an Environment.
390-
391-
:param string version: compiler version to use, like "80"
392-
:param string abi: 'win32' or whatever Itanium version wants
393-
:param string topdir: directory containing compiler tree, e.g.
394-
"c:\\Program Files\\Intel\\Compiler70".
395-
If `topdir` is used, `version` and `abi` are ignored.
396-
:param int verbose: if >0, prints compiler version used.
390+
args:
391+
version: (string) compiler version to use, like "80"
392+
abi: (string) 'win32' or whatever Itanium version wants
393+
topdir: (string) compiler top dir, like
394+
"c:\Program Files\Intel\Compiler70"
395+
If topdir is used, version and abi are ignored.
396+
verbose: (int) if >0, prints compiler version used.
397397
"""
398398
if not (is_mac or is_linux or is_windows):
399399
# can't handle this platform

SCons/Tool/packaging/rpm.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -302,23 +302,21 @@ def build_specfile_filesection(spec, files):
302302
return str
303303

304304
class SimpleTagCompiler:
305-
""" Compile RPM tags by doing simple string substitution.
305+
""" This class is a simple string substition utility:
306+
the replacement specfication is stored in the tagset dictionary, something
307+
like:
308+
{ "abc" : "cdef %s ",
309+
"abc_" : "cdef %s %s" }
306310
307-
The replacement specfication is stored in the *tagset* dictionary,
308-
something like:
309-
310-
{"abc" : "cdef %s ", "abc_": "cdef %s %s"}
311-
312-
The :func:`compile` function gets a value dictionary, which may look like:
313-
314-
{"abc": "ghij", "abc_gh": "ij"}
311+
the compile function gets a value dictionary, which may look like:
312+
{ "abc" : "ghij",
313+
"abc_gh" : "ij" }
315314
316315
The resulting string will be:
317-
318-
"cdef ghij cdef gh ij"
316+
"cdef ghij cdef gh ij"
319317
"""
320318
def __init__(self, tagset, mandatory=1):
321-
self.tagset = tagset
319+
self.tagset = tagset
322320
self.mandatory = mandatory
323321

324322
def compile(self, values):

SCons/Util.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,18 +1611,16 @@ def cmp(a, b):
16111611

16121612

16131613
def get_env_bool(env, name, default=False):
1614-
"""Convert a construction variable to bool.
1615-
1616-
If the value of *name* in *env* is 'true', 'yes', 'y', 'on' (case
1617-
insensitive) or anything convertible to int that yields non-zero then
1618-
return True; if 'false', 'no', 'n', 'off' (case insensitive)
1619-
or a number that converts to integer zero return False.
1620-
Otherwise, return *default*.
1621-
1622-
:param env: construction environment, or any dict-like object
1623-
:param name: name of the variable
1624-
:param default: value to return if name not in env or cannot be converted (default: False)
1625-
:rtype: bool
1614+
"""Get a value of env[name] converted to boolean. The value of env[name] is
1615+
interpreted as follows: 'true', 'yes', 'y', 'on' (case insensitive) and
1616+
anything convertible to int that yields non-zero integer are True values;
1617+
'0', 'false', 'no', 'n' and 'off' (case insensitive) are False values. For
1618+
all other cases, default value is returned.
1619+
1620+
:Parameters:
1621+
- `env` - dict or dict-like object, a convainer with variables
1622+
- `name` - name of the variable in env to be returned
1623+
- `default` - returned when env[name] does not exist or can't be converted to bool
16261624
"""
16271625
try:
16281626
var = env[name]
@@ -1640,10 +1638,7 @@ def get_env_bool(env, name, default=False):
16401638

16411639

16421640
def get_os_env_bool(name, default=False):
1643-
"""Convert an environment variable to bool.
1644-
1645-
Conversion is the same as for :func:`get_env_bool`.
1646-
"""
1641+
"""Same as get_env_bool(os.environ, name, default)."""
16471642
return get_env_bool(os.environ, name, default)
16481643

16491644
# Local Variables:

SCons/Variables/__init__.py

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,16 @@ class Variables:
4949
Holds all the options, updates the environment with the variables,
5050
and renders the help text.
5151
"""
52-
instance = None
53-
54-
def __init__(self, files=None, args=None, is_global=True):
55-
"""Create Variables instance.
56-
57-
If is_global is True, this is a singleton, create only once.
58-
59-
Args:
60-
files: [optional] List of option configuration files to load
61-
(backward compatibility). If a single string is passed it is
62-
automatically placed in a file list (Default value = None)
63-
args - dictionary to override values set from files.
64-
(Default value = None)
65-
is_global - global instance? (Default value = True)
52+
instance=None
6653

54+
def __init__(self, files=None, args=None, is_global=1):
55+
"""
56+
files - [optional] List of option configuration files to load
57+
(backward compatibility) If a single string is passed it is
58+
automatically placed in a file list
59+
args - dictionary to override values set from files.
6760
"""
61+
6862
if args is None:
6963
args = {}
7064
self.options = []
@@ -118,19 +112,18 @@ def keys(self):
118112
return [o.key for o in self.options]
119113

120114
def Add(self, key, help="", default=None, validator=None, converter=None, **kw):
121-
"""Add an option.
122-
123-
Args:
124-
key: the name of the variable, or a list or tuple of arguments
125-
help: optional help text for the options (Default value = "")
126-
default: optional default value for option (Default value = None)
127-
validator: optional function called to validate the option's value
128-
(Default value = None)
129-
converter: optional function to be called to convert the option's
130-
value before putting it in the environment. (Default value = None)
131-
kw: keyword args, unused.
115+
"""
116+
Add an option.
132117
118+
119+
@param key: the name of the variable, or a list or tuple of arguments
120+
@param help: optional help text for the options
121+
@param default: optional default value
122+
@param validator: optional function that is called to validate the option's value
123+
@type validator: Called with (key, value, environment)
124+
@param converter: optional function that is called to convert the option's value before putting it in the environment.
133125
"""
126+
134127
if SCons.Util.is_List(key) or isinstance(key, tuple):
135128
self._do_add(*key)
136129
return

SCons/cpp.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,8 @@ def resolve_include(self, t):
603603
604604
This handles recursive expansion of values without "" or <>
605605
surrounding the name until an initial " or < is found, to handle
606-
#include FILE where FILE is a #define somewhere else.
606+
#include FILE
607+
where FILE is a #define somewhere else.
607608
"""
608609
s = t[1].strip()
609610
while not s[0] in '<"':

0 commit comments

Comments
 (0)