Commit Graph

200 Commits

Author SHA1 Message Date
Tim Peters 54e5b89d77 SF bug #497839: reindent chokes on empty first lines.
Reindenter.run():  copy over initial all-whitespace lines (if any, and
after normalizing to remove trailing blanks and tabs).
Bugfix candidate.
2002-02-17 07:03:05 +00:00
Barry Warsaw 56ab9214c9 Added a module docstring, which doubles as the --help text.
Added a bunch of command line options to make the script more
generic.
2002-02-08 23:25:46 +00:00
Guido van Rossum 65f50156cd www.google.com is better than google.com. 2002-02-08 16:20:07 +00:00
Guido van Rossum 436fd75b4a Warning message about unfound file was missing trailing \n. 2001-12-06 03:28:17 +00:00
Guido van Rossum e51c3f5ecb SF patch #489680 (David Abrahams): h2py uses nonexistent method splitfields() 2001-12-06 03:24:30 +00:00
Guido van Rossum d3d8a1df5c A tiny but useful script that fires off a search on Google.
(Not sure if this is legal according to the Google terms of service. :-)
2001-12-04 15:23:47 +00:00
Guido van Rossum a30eacf458 Checking in Zooko's version per SF patch #476866, plus my changes to
the usage docs: (a) align properly, (b) explain properly.
2001-11-28 19:41:45 +00:00
Jeremy Hylton eaa6e3c712 Replace all instances of err.strerror with err.
The strerror attribute contained only partial information about the
exception and produced some very confusing error messages.  By passing
err (the exception object itself) and letting it convert itself to a
string, the error messages are better.
2001-10-08 20:33:20 +00:00
Tim Peters ba001a0b67 Changed the reindenter to strip only trailing spaces and tabs from lines,
not other control characters string.rstrip() got rid of.  This caters to
the \f thingies Barry likes putting in Python source files.
2001-10-04 19:44:10 +00:00
Tim Peters 2c9aa5ea8d Generalize file.writelines() to allow iterable objects. 2001-09-23 04:06:05 +00:00
Tim Peters 42b6877293 Fix restore (difflib.restore() became a generator too). 2001-09-22 21:59:18 +00:00
Tim Peters 8a9c284437 Make difflib.ndiff() and difflib.Differ.compare() generators. This
restores the 2.1 ability of Tools/scripts/ndiff.py to start producing
output before the entire comparison is complete.
2001-09-22 21:30:22 +00:00
Guido van Rossum a0ca3d611e - Reverse the meaning of the -m option: warnings about multiple /
operators per line or statement are now on by default, and -m turns
  these warnings off.

- Change the way multiple / operators are reported; a regular
  recommendation is always emitted after the warning.

- Report ambiguous warnings (both int|long and float|complex used for
  the same operator).

- Update the doc string again to clarify all this and describe the
  possible messages more precisely.
2001-09-04 16:22:01 +00:00
Tim Peters 83e7ccc9fd Whitespace normalization. 2001-09-04 06:37:28 +00:00
Guido van Rossum 1832de4bc0 PEP 238 documented -Qwarn as warning only for classic int or long
division, and this makes sense.  Add -Qwarnall to warn for all
classic divisions, as required by the fixdiv.py tool.
2001-09-04 03:51:09 +00:00
Guido van Rossum 61c345fa37 Rename the -D option to -Q, to avoid a Jython option name conflict. 2001-09-04 03:26:15 +00:00
Guido van Rossum e7a95983b0 Implement what the docstring said: multiple slashes per line are
treated the same as single ones by default.  Added -m option to issue
a warning for this case instead.
2001-09-02 14:11:30 +00:00
Guido van Rossum 13c51ecb8c Added more text to the docstring, updated the way the exit status is
percolated out, and some general cleanup.  The output is still the
same, except it now prints "Index: <file>" instead of "Processing:
<file>", so that the output can be used as input for patch (but only
the diff-style parts of it).
2001-09-02 04:49:36 +00:00
Guido van Rossum 43db62e263 A grep-like tool that looks for division operators. 2001-09-02 04:43:30 +00:00
Guido van Rossum 822218b400 The beginnings of a script to help finding / operators that may need
to be change to //.  The code is pretty gross so far, and I promise
I'll work on this more, but I have to go eat now! :-)
2001-09-01 21:55:58 +00:00
Tim Peters ebb7133f4f Fix typo in module docstring. 2001-08-15 06:07:42 +00:00
Tim Peters 3055ad234a + A msg on c.l.py reminded me that docstrings can be implicitly catenated.
Cater to that.
+ Major speed boost via not reading more of files than necessary.  This
  was no slouch before; now it screams.
+ Improve msg when giving up on a goofy future statement.
2001-08-13 05:33:53 +00:00
Tim Peters 5e824c37d3 SF patch #445412 extract ndiff functionality to difflib, from
David Goodger.
2001-08-12 22:25:01 +00:00
Tim Peters b704238a6c Tool to delete (or just rewrite parts of) obsolete future statements. 2001-08-12 08:41:13 +00:00
Martin v. Löwis f2f8c51ae6 When representing #includes as imports, do from MOD import *. 2001-08-09 12:32:10 +00:00
Martin v. Löwis 4f85bf3311 Patch #437683: Use re instead of regex.
If multiple header files are processed simultaneously which include each
other, the corresponding modules mport each other. Specifically, if h2py
is invoked with sys/types.h first, later header files won't contain the
complete contents of TYPES.py.
2001-08-09 12:24:38 +00:00
Tim Peters 45e5e72eb8 Rename pydoc.pyw to pydocgui.pyw: Since we changed Python to allow .pyw
files to satisfy imports, pydoc.pyw was just importing itself!
2001-08-05 05:43:20 +00:00
Fred Drake 79e75e1916 Use string.ascii_letters instead of string.letters (SF bug #226706). 2001-07-20 19:05:50 +00:00
Guido van Rossum 9966e2c663 This is a trivial command line utility to print MD5 checksums.
I published it on the web as http://www.python.org/2.1/md5sum.py
so I thought I might as well check it in.

Works with Python 1.5.2 and later.

Works like the Linux tool ``mdfsum file ...'' except it doesn't take
any options or read stdin.
2001-06-22 16:05:48 +00:00
Martin v. Löwis a4debfffc9 Patch #430754: Makes ftpmirror.py .netrc aware 2001-06-07 17:17:00 +00:00
Marc-André Lemburg 716cf91839 Moved the encoding map building logic from the individual mapping
codec files to codecs.py and added logic so that multi mappings
in the decoding maps now result in mappings to None (undefined mapping)
in the encoding maps.
2001-05-16 09:41:45 +00:00
Jeremy Hylton 66a7e57c7e Fix several bugs and add two features.
Assertion error message had typos in arguments to string format.

.cover files for modules in packages are now put in the right place.

The code that generate .cover files seemed to prepend a "./" to many
absolute paths, causing them to fail.  The code now checks explicitly
for absolute paths and leaves them alone.

In trace/coverage code, recover from case where module has no __name__
attribute, when e.g. it is executed by PyRun_String().  In this case,
assign modulename to None and hope for the best.  There isn't anywhere
to write out coverage data for this code anyway.

Also, replace several sys.stderr.writes with print >> sys.stderr.

New features:

-C/--coverdir dir: Generate .cover files in specified directory
instead of in the directory where the .py file is.

-s: Print a short summary of files coverred (# lines, % coverage,
name)
2001-05-08 04:20:52 +00:00
Guido van Rossum f9e56e117f Append the revision number for each file to the output.
(Yes, this is a new feature right before the 2.1 release.  No, I can't
imagine this would seriously break anybody's code.  In fact, most
users of this script are probably *happy* to see this addition.)
2001-04-10 03:31:27 +00:00
Ka-Ping Yee fde8a86a4e Script for starting pydoc with a GUI in Windows. 2001-03-23 14:10:39 +00:00
Ka-Ping Yee 895e8925d6 Call main routine in pydoc module (pydoc.cli). 2001-03-01 00:25:40 +00:00
Andrew M. Kuchling b68ef5081d Add script form of pydoc so that it's present in beta1. Currently
this just copies the __name__=='__main__' logic from pydoc.py.
    ?!ng can decide whether he wants to create a main() in pydoc, or rip
    it out of pydoc.py completely.
2001-02-28 20:55:10 +00:00
Tim Peters 9ae2148ada Moved SequenceMatcher from ndiff into new std library module difflib.py.
Guido told me to do this <wink>.
Greatly expanded docstrings, and fleshed out with examples.
New std test.
Added new get_close_matches() function for ESR.
Needs docs, but LaTeXification of the module docstring is all it needs.
\CVS: ----------------------------------------------------------------------
2001-02-10 08:00:53 +00:00
Tim Peters 79b334ba55 Hand repair of cases where reindent changed lines of the form
\t\t\t\t\treal code
##\t\t\t\t\tunused code
\t\t\t\t\treal code

via untabifying and shifting the real code left.  Semantically the
same but made the intent of the commented-out-in-column-0 unused code
unclear.  The exact same unused code appears to have gotten copied from
file to file over the years.
2001-01-17 09:13:33 +00:00
Tim Peters 70c4378dbc Whitespace normalization. 2001-01-17 08:48:39 +00:00
Marc-André Lemburg a866df806d This patch changes the default behaviour of the builtin charmap
codec to not apply Latin-1 mappings for keys which are not found
in the mapping dictionaries, but instead treat them as undefined
mappings.

The patch was originally written by Martin v. Loewis with some
additional (cosmetic) changes and an updated test script
by Marc-Andre Lemburg.

The standard codecs were recreated from the most current files
available at the Unicode.org site using the Tools/scripts/gencodec.py
tool.

This patch closes the bugs #116285 and #119960.
2001-01-03 21:29:14 +00:00
Tim Peters 2f1aeb950d SF bug 124051: ndiff "?" lines can be confusing. Well, they still can, but
after implementing it I liked Gregor's two-"?" line idea a lot.
2000-12-09 05:03:22 +00:00
Tim Peters 0d430e28c0 Hack ndiff to display lines w/ leading tabs more intuitively. This synchs
ndiff w/ a custom version I made for Guido during the pre-2.0 freeze.
2000-11-01 02:51:27 +00:00
Guido van Rossum 70280b859e I'm moving redemo.py here from Demo/tkinter/guido, since it is
somewhat useful to learn regular expressions, and this way it'll be
installed on Windows.

This closes bug report 115609.
2000-10-06 17:37:12 +00:00
Tim Peters ad14720262 New tool for normalizing indentation of .py files. 2000-10-05 03:48:38 +00:00
Jeremy Hylton 0b7b4b8a22 satisfy the tabnanny 2000-09-18 01:46:01 +00:00
Barry Warsaw 64850efa39 Allow this script to act like a module by only calling main() if
__name__ == '__main__'.  Closes SF bug #110844.
2000-09-16 22:09:51 +00:00
Guido van Rossum 8586991099 REMOVED all CWI, CNRI and BeOpen copyright markings.
This should match the situation in the 1.6b1 tree.
2000-09-01 23:29:29 +00:00
Guido van Rossum 1688f378cb Rob Hooft, Moshe Zadka: converted to 4 space indents and re instead of regex. 2000-09-01 13:41:37 +00:00
Jeremy Hylton da1ec468b1 Python code coverage tool by Skip Montanaro and Andrew Dalke 2000-08-03 19:26:21 +00:00
Peter Schneider-Kamp 7f589fddad add expandtabs command (-e)
change eliminate to delete (-d)
2000-07-11 16:43:16 +00:00