Close #15442: Expand the list of default directories ignored by filecmp.dircmp and expose it as a module attribute

This commit is contained in:
Eli Bendersky 2013-01-12 06:13:32 -08:00
parent 60a0c71031
commit eb2884a875
4 changed files with 32 additions and 12 deletions

View file

@ -55,10 +55,10 @@ The :class:`dircmp` class
.. class:: dircmp(a, b, ignore=None, hide=None)
Construct a new directory comparison object, to compare the directories *a* and
*b*. *ignore* is a list of names to ignore, and defaults to ``['RCS', 'CVS',
'tags']``. *hide* is a list of names to hide, and defaults to ``[os.curdir,
os.pardir]``.
Construct a new directory comparison object, to compare the directories *a*
and *b*. *ignore* is a list of names to ignore, and defaults to
:attr:`filecmp.DEFAULT_IGNORES`. *hide* is a list of names to hide, and
defaults to ``[os.curdir, os.pardir]``.
The :class:`dircmp` class compares files by doing *shallow* comparisons
as described for :func:`filecmp.cmp`.
@ -164,6 +164,12 @@ The :class:`dircmp` class
A dictionary mapping names in :attr:`common_dirs` to :class:`dircmp`
objects.
.. attribute:: DEFAULT_IGNORES
.. versionadded:: 3.3
List of directories ignored by :class:`dircmp` by default.
Here is a simplified example of using the ``subdirs`` attribute to search
recursively through two directories to show common different files::