This is a conservative version of SF patch 504889. It uses the log
module instead of calling print in various places, and it ignores the
verbose argument passed to many functions and set as an attribute on
some objects. Instead, it uses the verbosity set on the logger via
the command line.
The log module is now preferred over announce() and warn() methods
that exist only for backwards compatibility.
XXX This checkin changes a lot of modules that have no test suite and
aren't exercised by the Python build process. It will need
substantial testing.
prevent binding for str from masking use of builtin str in nested
function.
(This is the only case I found in the standard library where a local
shadows a global or builtin. There may be others, but the regression
test doesn't catch them.)
This patch adds support for Cygwin to util.get_platform(). A Cygwin
specific case is needed due to the format of Cygwin's uname command,
which contains '/' characters.
about how it would be nice to write absolute paths to the temporary
byte-compilation script, but this doesn't work because it screws up the
trailing-slash trickery done to 'prefix' in build_py's 'byte_compile()'
method.
Fixed to use 'execute()' instead of 'os.remove()' to remove the temporary
script: now it doesn't blow up in dry-run mode!
standard 'py_compile.compile()' function. Laundry list of features:
- handles standard Distutils 'force', 'verbose', 'dry_run' flags
- handles various levels of optimization: can compile directly in
this interpreter process, or write a temporary script that is
then executed by a new interpreter with the appropriate flags
- can rewrite the source filename by stripping an optional prefix
and preprending an optional base dir.
Unix shell-like syntax (eg. in Python's Makefile, for one thing -- now that
I have this function, I'll probably allow quoted strings in config files too.
even if it's already absolute. Currently only implemented for Unix; I'm
not entirely sure of the right thing to do for DOS/Windows, and have no
clue what to do for Mac OS.
- DistutilsOptionError is now documented as it's actually used, ie.
to indicate bogus option values (usually user options, eg. from
the command-line)
- added DistutilsSetupError to indicate errors that definitely arise
in the setup script
- got rid of DistutilsValueError, and changed all usage of it to
either DistutilsSetupError or ValueError as appropriate
- simplified a bunch of option get/set methods in Command and
Distribution classes -- just pass on AttributeError most of
the time, rather than turning it into something else
- file_util.py: operations on single files
- dir_util.py: operations on whole directories or directory trees
- dep_util.py: simple timestamp-based dependency analysis
- archive_util.py: creation of archive (tar, zip, ...) files
The functions left in util.py are miscellany that don't fit in any of the
new files.