Commit Graph

21 Commits

Author SHA1 Message Date
Benjamin Peterson fcfa7ead4f close files after comparing them 2009-03-19 03:04:31 +00:00
Brett Cannon 25c9d6aa00 Remove imports of 'warnings' that are no longer needed in dummy_thread,
filecmp, and shelve.
2008-08-17 22:10:11 +00:00
Brett Cannon c66b03a4c1 Move filecmp from using dict.has_key() to dict.__contains__() to silence
warnings triggered under -3.
2008-08-03 23:46:46 +00:00
Raymond Hettinger f3fa9460de Removed deprecated use_statcache argument. 2004-12-05 01:58:09 +00:00
Raymond Hettinger eeca37e0b5 SF bug #453515: filecmp.dircmp case sensitivity bug 2003-09-02 05:42:02 +00:00
Raymond Hettinger 05595e9d73 Module review:
* Changed variable name from 'list' to 'flist'.
* Replaced "while 1" with "while True".
* Replaced if/elif/elif/elif structure with a shorter and
  faster dispatch dictionary that maps attrs to methods.
* Simplified and sped comparison logic by using
  ifilter, ifilterfalse, and dict.fromkeys.
* Used True and False rather than 1 and 0.
2003-02-27 00:05:31 +00:00
Andrew M. Kuchling 83e879d99f Add DeprecationWarning when use_statcache argument is supplied
Fix use of GetoptError, so demo() now works
2003-02-06 19:38:45 +00:00
Andrew M. Kuchling 8eb4044f7e [Bug #680494] filecmp.py uses obsolete statcache module.
Simply replace all uses of statcache with os.stat.

Should I add a DeprecationWarning triggered if the use_statcache argument
is supplied, so we can remove it in 2.4?
2003-02-06 17:50:01 +00:00
Raymond Hettinger e0d4972acc Replaced .keys() with dictionary iterators 2002-06-02 18:55:56 +00:00
Raymond Hettinger 32200aeac6 Replaced obsolete stat module constants with equivalent attributes 2002-06-01 19:51:15 +00:00
Tim Peters bc0e910826 Convert a pile of obvious "yes/no" functions to return bool. 2002-04-04 22:55:58 +00:00
Skip Montanaro eccd02a40d more __all__ updates 2001-01-20 23:34:12 +00:00
Tim Peters 88869f9787 Whitespace normalization. 2001-01-14 23:36:06 +00:00
Fred Drake 8152d32375 Update the code to better reflect recommended style:
Use != instead of <> since <> is documented as "obsolescent".
Use "is" and "is not" when comparing with None or type objects.
2000-12-12 23:20:45 +00:00
Moshe Zadka afb17fc7b2 Call of _cmp had wrong number of paramereters.
Fixed definition of _cmp.
2000-12-03 20:48:07 +00:00
Fred Drake 2b0d98bc7f cmpfiles(): Added shallow and use_statcache parameters, with same meanings
and defaults as for filecmp.cmp().  Updated docstring
             accordingly, and formatted it more like others in the standard
             library.
2000-07-03 08:18:47 +00:00
Guido van Rossum 63b08ac2f7 Whoops! We just discovered that Gordon's revamp of this module was
accidentally wiped out by Ping's patch (which shouldn't have affected
this file at all, had Ping done a cvs update).

This checkin restores Gordon's version, with Fredrik's change merged
back in.
2000-06-29 14:13:28 +00:00
Guido van Rossum 1916b35f58 Fredrik Lundh:
The new filecmp module has an optional argument called use_statcache
which is documented as a true/false value, but used as an tuple index.

This patches replaces the tuple stuff with a good old if- statement,
and also removes a few other tuple pack/unpack constructs (if not
else, this saves a few bytes in the PYC file, and a few microseconds
when using the module ;-).
2000-03-28 21:42:38 +00:00
Guido van Rossum 54f22ed30b More trivial comment -> docstring transformations by Ka-Ping Yee,
who writes:

Here is batch 2, as a big collection of CVS context diffs.
Along with moving comments into docstrings, i've added a
couple of missing docstrings and attempted to make sure more
module docstrings begin with a one-line summary.

I did not add docstrings to the methods in profile.py for
fear of upsetting any careful optimizations there, though
i did move class documentation into class docstrings.

The convention i'm using is to leave credits/version/copyright
type of stuff in # comments, and move the rest of the descriptive
stuff about module usage into module docstrings.  Hope this is
okay.
2000-02-04 15:10:34 +00:00
Guido van Rossum 43265beff9 # module filecmp
# combo of old cmp, cmpcache and dircmp with redundancies removed
#
# bugs fixed:
#   dircmp.dircmp was not ignoring IGNORES
#   old stuff could falsely report files as "identical" when contents actually differed
#
# enhancements:
#   dircmp has a more straightforward interface
#cmp enhanced by Moshe Zadca
#dircmp enhanced byGordon McMillan

[some layout changes by GvR]
2000-02-03 00:41:22 +00:00
Guido van Rossum 2d72687006 New module by Moshe Zadka (submitted on Sept. 25). This unifies the
functionality of cmp.py and cmpcache.py, which are hereby declared
obsolescent.
1999-10-26 14:02:01 +00:00