summaryrefslogtreecommitdiffstats
path: root/SCons/Environment.py
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2020-05-30 13:33:27 (GMT)
committerMats Wichmann <mats@linux.com>2020-05-30 16:58:49 (GMT)
commit0f89d1bacbfb8f3983a705c1a507916e9260f93b (patch)
tree6343a6d294c2fe967d632f463065e10a76c24484 /SCons/Environment.py
parent19f6d2c0d64928e87383a76146981dbfee1fee1c (diff)
downloadSCons-0f89d1bacbfb8f3983a705c1a507916e9260f93b.zip
SCons-0f89d1bacbfb8f3983a705c1a507916e9260f93b.tar.gz
SCons-0f89d1bacbfb8f3983a705c1a507916e9260f93b.tar.bz2
Docstring changes from Sphinx conversion [ci skip]
These changes are prompted by complaints Sphinx makes about existing docstrings; split from the Sphinx-build PR to make for easier reviewing. Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'SCons/Environment.py')
-rw-r--r--SCons/Environment.py45
1 files changed, 27 insertions, 18 deletions
diff --git a/SCons/Environment.py b/SCons/Environment.py
index cd52ee5..f9af099 100644
--- a/SCons/Environment.py
+++ b/SCons/Environment.py
@@ -1502,11 +1502,16 @@ class Base(SubstitutionEnvironment):
def Dictionary(self, *args):
"""Return construction variables from an environment.
- :param *args: (optional) variable names to look up
- :returns: if args omitted, the dictionary of all constr. vars.
- If one arg, the corresponding value is returned.
- If more than one arg, a list of values is returned.
- :raises KeyError: if any of *args is not in the construction env.
+ Args:
+ \*args (optional): variable names to look up
+
+ Returns:
+ If `args` omitted, the dictionary of all construction variables.
+ If one arg, the corresponding value is returned.
+ If more than one arg, a list of values is returned.
+
+ Raises:
+ KeyError: if any of `args` is not in the construction environment.
"""
if not args:
@@ -1518,14 +1523,15 @@ class Base(SubstitutionEnvironment):
def Dump(self, key=None, format='pretty'):
- """ Serialize the construction variables to a string.
+ """ Return construction variables serialized to a string.
- :param key: if None, format the whole dict of variables.
- Else look up and format just the value for key.
-
- :param format: specify the format of the variables to be serialized:
- - pretty: pretty-printed string.
- - json: JSON-formatted string.
+ Args:
+ key (optional): if None, format the whole dict of variables.
+ Else format the value of `key` (Default value = None)
+ format (optional): specify the format to serialize to.
+ `"pretty"` generates a pretty-printed string,
+ `"json"` a JSON-formatted string.
+ (Default value = None, equivalent to `"pretty"`)
"""
if key:
@@ -1556,12 +1562,15 @@ class Base(SubstitutionEnvironment):
def FindIxes(self, paths, prefix, suffix):
- """
- Search a list of paths for something that matches the prefix and suffix.
+ """Search a list of paths for something that matches the prefix and suffix.
+
+ Args:
+ paths: the list of paths or nodes.
+ prefix: construction variable for the prefix.
+ suffix: construction variable for the suffix.
+
+ Returns: the matched path or None
- paths - the list of paths or nodes.
- prefix - construction variable for the prefix.
- suffix - construction variable for the suffix.
"""
suffix = self.subst('$'+suffix)
@@ -2017,7 +2026,7 @@ class Base(SubstitutionEnvironment):
pass
else:
del kw['target_factory']
-
+
bld = SCons.Builder.Builder(**bkw)
return bld(self, target, source, **kw)