diff options
author | Éric Araujo <merwok@netwok.org> | 2011-07-28 21:08:11 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-07-28 21:08:11 (GMT) |
commit | cf534817adc49b2562d175fabd3e3992d25063fe (patch) | |
tree | d2cb18e71d6b5cc25384146751b00c2172a327b6 /Doc/library | |
parent | 9e1af03fbb2a9fc1472ac866add02c99b0c88b16 (diff) | |
parent | fc662ddda2bfd43b10c0a4f8a814e36445f22515 (diff) | |
download | cpython-cf534817adc49b2562d175fabd3e3992d25063fe.zip cpython-cf534817adc49b2562d175fabd3e3992d25063fe.tar.gz cpython-cf534817adc49b2562d175fabd3e3992d25063fe.tar.bz2 |
Branch merge
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/profile.rst | 26 | ||||
-rw-r--r-- | Doc/library/shutil.rst | 26 |
2 files changed, 17 insertions, 35 deletions
diff --git a/Doc/library/profile.rst b/Doc/library/profile.rst index 3931836..ca54021 100644 --- a/Doc/library/profile.rst +++ b/Doc/library/profile.rst @@ -39,7 +39,7 @@ The Python standard library provides two different profilers: 2. :mod:`profile`, a pure Python module whose interface is imitated by :mod:`cProfile`. Adds significant overhead to profiled programs. If you're trying to extend the profiler in some way, the task might be easier with this - module. Copyright © 1994, by InfoSeek Corporation. + module. The :mod:`profile` and :mod:`cProfile` modules export the same interface, so they are mostly interchangeable; :mod:`cProfile` has a much lower overhead but @@ -592,27 +592,3 @@ The resulting profiler will then call :func:`your_time_func`. functions should be used with care and should be as fast as possible. For the best results with a custom timer, it might be necessary to hard-code it in the C source of the internal :mod:`_lsprof` module. - - -Copyright and License Notices -============================= - -Copyright © 1994, by InfoSeek Corporation, all rights reserved. - -Permission to use, copy, modify, and distribute this Python software and its -associated documentation for any purpose (subject to the restriction in the -following sentence) without fee is hereby granted, provided that the above -copyright notice appears in all copies, and that both that copyright notice and -this permission notice appear in supporting documentation, and that the name of -InfoSeek not be used in advertising or publicity pertaining to distribution of -the software without specific, written prior permission. This permission is -explicitly restricted to the copying and modification of the software to remain -in Python, compiled Python, or other languages (such as C) wherein the modified -or derived code is exclusively imported into a Python module. - -INFOSEEK CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT -SHALL INFOSEEK CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING -OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index 1f194a0..5e5f8c9 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -159,19 +159,25 @@ Directory and files operations .. function:: move(src, dst) - Recursively move a file or directory to another location. + Recursively move a file or directory (*src*) to another location (*dst*). - Uses :func:`os.rename` to perform the move. If it fails, for reasons such as - when *src* and *dst* are on different filesystems or in case of windows where - rename is not supported when *dst* exists, fallback to copying *src* (with - :func:`copy2`) to the *dst* and then remove *src*. + If the destination is a directory or a symlink to a directory, then *src* is + moved inside that directory. + + The destination directory must not already exist. If the destination already + exists but is not a directory, it may be overwritten depending on + :func:`os.rename` semantics. + + If the destination is on the current filesystem, then :func:`os.rename` is + used. Otherwise, *src* is copied (using :func:`copy2`) to *dst* and then + removed. .. exception:: Error - This exception collects exceptions that raised during a multi-file operation. For - :func:`copytree`, the exception argument is a list of 3-tuples (*srcname*, - *dstname*, *exception*). + This exception collects exceptions that are raised during a multi-file + operation. For :func:`copytree`, the exception argument is a list of 3-tuples + (*srcname*, *dstname*, *exception*). .. _shutil-example: @@ -269,7 +275,7 @@ Archiving operations .. function:: get_archive_formats() - Returns a list of supported formats for archiving. + Return a list of supported formats for archiving. Each element of the returned sequence is a tuple ``(name, description)`` By default :mod:`shutil` provides these formats: @@ -287,7 +293,7 @@ Archiving operations .. function:: register_archive_format(name, function, [extra_args, [description]]) - Registers an archiver for the format *name*. *function* is a callable that + Register an archiver for the format *name*. *function* is a callable that will be used to invoke the archiver. If given, *extra_args* is a sequence of ``(name, value)`` pairs that will be |