[Python-checkins] cpython (3.2): Improve interlinking of archiving/compression modules docs.
eric.araujo
python-checkins at python.org
Sun Feb 5 13:50:15 CET 2012
http://hg.python.org/cpython/rev/11bd2d32b4e8
changeset: 74790:11bd2d32b4e8
branch: 3.2
user: Éric Araujo <merwok at netwok.org>
date: Mon Jan 16 16:55:55 2012 +0100
summary:
Improve interlinking of archiving/compression modules docs.
- Remove duplicated list of links to the other modules from each
module’s doc (people can already go up to library/archiving and
there they can see the list).
- Link to shutil high-level operations.
Reviewed by Nadeem Vawda in #6715.
files:
Doc/library/archiving.rst | 1 +
Doc/library/bz2.rst | 3 ---
Doc/library/gzip.rst | 3 ---
Doc/library/shutil.rst | 10 +++++++---
Doc/library/tarfile.rst | 3 ++-
Doc/library/zipfile.rst | 3 ---
Doc/library/zlib.rst | 4 +---
7 files changed, 11 insertions(+), 16 deletions(-)
diff --git a/Doc/library/archiving.rst b/Doc/library/archiving.rst
--- a/Doc/library/archiving.rst
+++ b/Doc/library/archiving.rst
@@ -6,6 +6,7 @@
The modules described in this chapter support data compression with the zlib,
gzip, and bzip2 algorithms, and the creation of ZIP- and tar-format archives.
+See also :ref:`archiving-operations` provided by the :mod:`shutil` module.
.. toctree::
diff --git a/Doc/library/bz2.rst b/Doc/library/bz2.rst
--- a/Doc/library/bz2.rst
+++ b/Doc/library/bz2.rst
@@ -12,9 +12,6 @@
It implements a complete file interface, one-shot (de)compression functions, and
types for sequential (de)compression.
-For other archive formats, see the :mod:`gzip`, :mod:`zipfile`, and
-:mod:`tarfile` modules.
-
Here is a summary of the features offered by the bz2 module:
* :class:`BZ2File` class implements a complete file interface, including
diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst
--- a/Doc/library/gzip.rst
+++ b/Doc/library/gzip.rst
@@ -21,9 +21,6 @@
:program:`gzip` and :program:`gunzip` programs, such as those produced by
:program:`compress` and :program:`pack`, are not supported by this module.
-For other archive formats, see the :mod:`bz2`, :mod:`zipfile`, and
-:mod:`tarfile` modules.
-
The module defines the following items:
diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst
--- a/Doc/library/shutil.rst
+++ b/Doc/library/shutil.rst
@@ -31,6 +31,8 @@
are not copied.
+.. _file-operations:
+
Directory and files operations
------------------------------
@@ -181,7 +183,7 @@
(*srcname*, *dstname*, *exception*).
-.. _shutil-example:
+.. _shutil-copytree-example:
copytree example
::::::::::::::::
@@ -248,6 +250,9 @@
Archiving operations
--------------------
+High-level utilities to create and read compressed and archived files are also
+provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules.
+
.. function:: make_archive(base_name, format, [root_dir, [base_dir, [verbose, [dry_run, [owner, [group, [logger]]]]]]])
Create an archive file (such as zip or tar) and return its name.
@@ -375,6 +380,7 @@
.. versionadded:: 3.2
+.. _shutil-archiving-example:
Archiving example
:::::::::::::::::
@@ -400,5 +406,3 @@
-rw------- tarek/staff 1675 2008-06-09 13:26:54 ./id_rsa
-rw-r--r-- tarek/staff 397 2008-06-09 13:26:54 ./id_rsa.pub
-rw-r--r-- tarek/staff 37192 2010-02-06 18:23:10 ./known_hosts
-
-
diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst
--- a/Doc/library/tarfile.rst
+++ b/Doc/library/tarfile.rst
@@ -14,7 +14,8 @@
The :mod:`tarfile` module makes it possible to read and write tar
archives, including those using gzip or bz2 compression.
-(:file:`.zip` files can be read and written using the :mod:`zipfile` module.)
+Use the :mod:`zipfile` module to read or write :file:`.zip` files, or the
+higher-level functions in :ref:`shutil <archiving-operations>`.
Some facts and figures:
diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst
--- a/Doc/library/zipfile.rst
+++ b/Doc/library/zipfile.rst
@@ -23,9 +23,6 @@
create an encrypted file. Decryption is extremely slow as it is
implemented in native Python rather than C.
-For other archive formats, see the :mod:`bz2`, :mod:`gzip`, and
-:mod:`tarfile` modules.
-
The module defines the following items:
.. exception:: BadZipFile
diff --git a/Doc/library/zlib.rst b/Doc/library/zlib.rst
--- a/Doc/library/zlib.rst
+++ b/Doc/library/zlib.rst
@@ -18,9 +18,7 @@
consult the zlib manual at http://www.zlib.net/manual.html for authoritative
information.
-For reading and writing ``.gz`` files see the :mod:`gzip` module. For
-other archive formats, see the :mod:`bz2`, :mod:`zipfile`, and
-:mod:`tarfile` modules.
+For reading and writing ``.gz`` files see the :mod:`gzip` module.
The available exception and functions in this module are:
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list