Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f2fbb9c

Browse files
committed
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.
1 parent 6f7aa00 commit f2fbb9c

7 files changed

Lines changed: 11 additions & 16 deletions

File tree

Doc/library/archiving.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Data Compression and Archiving
66

77
The modules described in this chapter support data compression with the zlib,
88
gzip, and bzip2 algorithms, and the creation of ZIP- and tar-format archives.
9+
See also :ref:`archiving-operations` provided by the :mod:`shutil` module.
910

1011

1112
.. toctree::

Doc/library/bz2.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ This module provides a comprehensive interface for the bz2 compression library.
1212
It implements a complete file interface, one-shot (de)compression functions, and
1313
types for sequential (de)compression.
1414

15-
For other archive formats, see the :mod:`gzip`, :mod:`zipfile`, and
16-
:mod:`tarfile` modules.
17-
1815
Here is a summary of the features offered by the bz2 module:
1916

2017
* :class:`BZ2File` class implements a complete file interface, including

Doc/library/gzip.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ Note that additional file formats which can be decompressed by the
2121
:program:`gzip` and :program:`gunzip` programs, such as those produced by
2222
:program:`compress` and :program:`pack`, are not supported by this module.
2323

24-
For other archive formats, see the :mod:`bz2`, :mod:`zipfile`, and
25-
:mod:`tarfile` modules.
26-
2724
The module defines the following items:
2825

2926

Doc/library/shutil.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ copying and removal. For operations on individual files, see also the
3131
are not copied.
3232

3333

34+
.. _file-operations:
35+
3436
Directory and files operations
3537
------------------------------
3638

@@ -181,7 +183,7 @@ Directory and files operations
181183
(*srcname*, *dstname*, *exception*).
182184

183185

184-
.. _shutil-example:
186+
.. _shutil-copytree-example:
185187

186188
copytree example
187189
::::::::::::::::
@@ -248,6 +250,9 @@ Another example that uses the *ignore* argument to add a logging call::
248250
Archiving operations
249251
--------------------
250252

253+
High-level utilities to create and read compressed and archived files are also
254+
provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules.
255+
251256
.. function:: make_archive(base_name, format, [root_dir, [base_dir, [verbose, [dry_run, [owner, [group, [logger]]]]]]])
252257

253258
Create an archive file (such as zip or tar) and return its name.
@@ -375,6 +380,7 @@ Archiving operations
375380
.. versionadded:: 3.2
376381

377382

383+
.. _shutil-archiving-example:
378384

379385
Archiving example
380386
:::::::::::::::::
@@ -400,5 +406,3 @@ The resulting archive contains::
400406
-rw------- tarek/staff 1675 2008-06-09 13:26:54 ./id_rsa
401407
-rw-r--r-- tarek/staff 397 2008-06-09 13:26:54 ./id_rsa.pub
402408
-rw-r--r-- tarek/staff 37192 2010-02-06 18:23:10 ./known_hosts
403-
404-

Doc/library/tarfile.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
The :mod:`tarfile` module makes it possible to read and write tar
1616
archives, including those using gzip or bz2 compression.
17-
(:file:`.zip` files can be read and written using the :mod:`zipfile` module.)
17+
Use the :mod:`zipfile` module to read or write :file:`.zip` files, or the
18+
higher-level functions in :ref:`shutil <archiving-operations>`.
1819

1920
Some facts and figures:
2021

Doc/library/zipfile.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ decryption of encrypted files in ZIP archives, but it currently cannot
2323
create an encrypted file. Decryption is extremely slow as it is
2424
implemented in native Python rather than C.
2525

26-
For other archive formats, see the :mod:`bz2`, :mod:`gzip`, and
27-
:mod:`tarfile` modules.
28-
2926
The module defines the following items:
3027

3128
.. exception:: BadZipFile

Doc/library/zlib.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ order. This documentation doesn't attempt to cover all of the permutations;
1818
consult the zlib manual at http://www.zlib.net/manual.html for authoritative
1919
information.
2020

21-
For reading and writing ``.gz`` files see the :mod:`gzip` module. For
22-
other archive formats, see the :mod:`bz2`, :mod:`zipfile`, and
23-
:mod:`tarfile` modules.
21+
For reading and writing ``.gz`` files see the :mod:`gzip` module.
2422

2523
The available exception and functions in this module are:
2624

0 commit comments

Comments
 (0)