Commit e125b16f authored by Greg Ward's avatar Greg Ward

Reformat docstrings.

parent cade95e3
...@@ -59,15 +59,15 @@ def get_platform (): ...@@ -59,15 +59,15 @@ def get_platform ():
def convert_path (pathname): def convert_path (pathname):
"""Return 'pathname' as a name that will work on the native """Return 'pathname' as a name that will work on the native filesystem,
filesystem, i.e. split it on '/' and put it back together again i.e. split it on '/' and put it back together again using the current
using the current directory separator. Needed because filenames in directory separator. Needed because filenames in the setup script are
the setup script are always supplied in Unix style, and have to be always supplied in Unix style, and have to be converted to the local
converted to the local convention before we can actually use them in convention before we can actually use them in the filesystem. Raises
the filesystem. Raises ValueError if 'pathname' is ValueError if 'pathname' is absolute (starts with '/') or contains
absolute (starts with '/') or contains local directory separators local directory separators (unless the local separator is '/', of
(unless the local separator is '/', of course).""" course).
"""
if os.sep == '/': if os.sep == '/':
return pathname return pathname
if pathname[0] == '/': if pathname[0] == '/':
...@@ -116,13 +116,12 @@ def change_root (new_root, pathname): ...@@ -116,13 +116,12 @@ def change_root (new_root, pathname):
_environ_checked = 0 _environ_checked = 0
def check_environ (): def check_environ ():
"""Ensure that 'os.environ' has all the environment variables we """Ensure that 'os.environ' has all the environment variables we
guarantee that users can use in config files, command-line guarantee that users can use in config files, command-line options,
options, etc. Currently this includes: etc. Currently this includes:
HOME - user's home directory (Unix only) HOME - user's home directory (Unix only)
PLAT - description of the current platform, including hardware PLAT - description of the current platform, including hardware
and OS (see 'get_platform()') and OS (see 'get_platform()')
""" """
global _environ_checked global _environ_checked
if _environ_checked: if _environ_checked:
return return
...@@ -138,15 +137,15 @@ def check_environ (): ...@@ -138,15 +137,15 @@ def check_environ ():
def subst_vars (str, local_vars): def subst_vars (str, local_vars):
"""Perform shell/Perl-style variable substitution on 'string'. """Perform shell/Perl-style variable substitution on 'string'. Every
Every occurrence of '$' followed by a name, or a name enclosed in occurrence of '$' followed by a name, or a name enclosed in braces, is
braces, is considered a variable. Every variable is substituted by considered a variable. Every variable is substituted by the value
the value found in the 'local_vars' dictionary, or in 'os.environ' found in the 'local_vars' dictionary, or in 'os.environ' if it's not in
if it's not in 'local_vars'. 'os.environ' is first checked/ 'local_vars'. 'os.environ' is first checked/ augmented to guarantee
augmented to guarantee that it contains certain values: see that it contains certain values: see '_check_environ()'. Raise
'_check_environ()'. Raise ValueError for any variables not found in ValueError for any variables not found in either 'local_vars' or
either 'local_vars' or 'os.environ'.""" 'os.environ'.
"""
check_environ() check_environ()
def _subst (match, local_vars=local_vars): def _subst (match, local_vars=local_vars):
var_name = match.group(1) var_name = match.group(1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment