Commit Graph

320 Commits

Author SHA1 Message Date
Skip Montanaro 4aba6f51cb The bagpipe didn't say "no" (*), so here's a main program script useful for
running an application under hotshot's control.  Only slightly embellished
from what Walter Dörwald posted to python-dev.

(*) http://www.icdc.com/~roadkill/silverstein/turtle.html
2004-01-26 19:44:48 +00:00
Skip Montanaro 48f9c6dfb8 allow dump/load of gdbm files 2003-10-28 16:17:54 +00:00
Walter Dörwald f0dfc7ac5c Fix a bunch of typos in documentation, docstrings and comments.
(From SF patch #810751)
2003-10-20 14:01:56 +00:00
Raymond Hettinger c60577ea59 Generalize the last change to check for other markup spacing errors. 2003-09-08 18:43:46 +00:00
Raymond Hettinger b9c07af46c Check for \NULL markup errors. 2003-09-08 17:33:31 +00:00
Raymond Hettinger e41d4c8ec9 Added doubled word warnings. 2003-08-25 04:39:55 +00:00
Tim Peters 1a3abcb648 This started opening files in text mode by default in the 2.3 release,
which is a disaster on Windows.  Restored the binary default of all
previous releases.  Also minor code cleanups.

Bugfix candidate!
2003-08-18 23:52:09 +00:00
Fred Drake 7d599482f2 When piping output into a pager like "less", quiting the pager before
the output was consumed would cause and exception to be raise in
logmerge; suppress this specific error, because it's not helpful.
2003-08-14 15:52:33 +00:00
Skip Montanaro 7f7e1371eb fix for bug 773020 - splitting PATH should use os.pathsep 2003-07-17 16:45:43 +00:00
Jeremy Hylton 5ec79681d2 This file was moved to Lib/. 2003-07-07 16:09:24 +00:00
Skip Montanaro 8df717a499 minor __doc__ string tweakage 2003-06-20 01:01:19 +00:00
Skip Montanaro c5e5e51a3a typo 2003-06-20 01:00:20 +00:00
Walter Dörwald fc1efa371a Make the comment prefix 7 character long, so the lines are properly
aligned.
2003-06-19 10:36:17 +00:00
Guido van Rossum ab537e92f3 Put the main script for the new IDLE here. 2003-06-13 20:34:27 +00:00
Raymond Hettinger a33d177589 Added a command line interface for difflib.py 2003-06-08 23:04:17 +00:00
Martin v. Löwis bb640c15a1 Patch #748849: Update to current tools and demos. 2003-06-07 18:46:34 +00:00
Raymond Hettinger 6e0f5e077a * Added file globbing to make it easier to check many LaTeX files.
* Delimiter mismatch now prints a warning instead of raising an exception.
* Offer style warnings for use of e.g. and i.e.
* Bypass false positive warnings for forward slashes in urls and in /rfc822.
* Put non-LaTex delimiter matching first to make -d option more reliable.
2003-05-16 03:06:39 +00:00
Raymond Hettinger 071b0bc9f8 Forward slash warnings now only occur for potentially valid LaTeX commands.
(Idea contributed by Anthony Baxter.)
2003-05-14 18:15:55 +00:00
Andrew M. Kuchling ac6df95d07 Fix use of 'file' as a variable name.
(I've tested the fixes, but please proofread anyway.)
2003-05-13 18:14:25 +00:00
Andrew M. Kuchling a2f7728341 Prevent script from allowing '-r12' 2003-05-13 17:56:07 +00:00
Andrew M. Kuchling 4693d46fef Rename sum5.py to md5sum.py, because sum5.py is more interesting
as an example program
2003-05-13 17:39:26 +00:00
Andrew M. Kuchling fb9653a63f Don't use 'file' as a variable name
Modernize the code a bit
Add docstring
2003-05-13 17:38:05 +00:00
Andrew M. Kuchling 87ddce1bf0 [Bug #724767] Avoid use of 'file' as a variable name 2003-05-13 17:09:01 +00:00
Andrew M. Kuchling 47172b4fab [Bug #724767] crlf.py uses the variable name file, which it shouldn't anymore. 2003-05-13 14:51:39 +00:00
Raymond Hettinger 62aa994633 * Added separate checks for matching braces.
* Added more LaTex cmds from the docs.
* Blocked forward-slash warnings with delimiters-only option.
* Put help message on shorter line to fit an 80 char screen.
2003-05-12 23:33:28 +00:00
Raymond Hettinger 4f0c6b2b70 Minor fixups. 2003-05-10 09:04:37 +00:00
Raymond Hettinger 0fd525fd1c Add table level validation and made minor fix-ups. 2003-05-10 07:41:55 +00:00
Raymond Hettinger 71e0033200 Added a tool for making a rough check of LaTeX documents.
It checks for known commands, forward slashes, unbalanced or
mismatched delimters, and unbalanced or mismatched begin/end blocks.
2003-05-10 03:30:13 +00:00
Tim Peters 0eadaac7dc Whitespace normalization. 2003-04-24 16:02:54 +00:00
Barry Warsaw 334df6c597 Finally added a -h option to print the module docstring and exit. ;) 2003-04-20 00:59:24 +00:00
Tim Peters 53f72d7dcd Docstring clarifications. 2003-04-19 18:21:04 +00:00
Guido van Rossum 6869458236 Don't double-space the "??? new object ..." messages. 2003-04-18 19:51:10 +00:00
Tim Peters 8d17a90b83 Heh -- I checked in an old version of this, at a time I documented the
internal read() as being a generator but hadn't yet changed it into one.
2003-04-18 01:02:37 +00:00
Tim Peters 21d7d4d5ca _Py_PrintReferenceAddresses(): also print the type name. In real use
I'm finding some pretty baffling output, like reprs consisting entirely
of three left parens.  At least this will let us know what type the object
is (it's not str -- there's no quote character in the repr).

New tool combinerefs.py, to combine the two output blocks produced via
PYTHONDUMPREFS.
2003-04-18 00:45:59 +00:00
Guido van Rossum 21123ab7e5 Various improvements to the way the table is formatted, to deal with
exceptionally large totals etc.
2003-04-09 19:10:46 +00:00
Skip Montanaro f2f174f655 install timeit.py as a command line script 2003-04-08 19:50:02 +00:00
Skip Montanaro ea7598e6f4 fix name of db2pickle 2003-03-07 00:47:40 +00:00
Andrew M. Kuchling d683504b85 Use new name for GetoptError, and pass it two arguments
Use re module instead of regex
2003-02-06 19:55:35 +00:00
Skip Montanaro da72d9376b try to avoid gross incompatibilities with older versions of Python 2003-02-03 15:29:34 +00:00
Skip Montanaro 7c1274d8ab try to avoid gross incompatibilities with earlier versions of Python 2003-02-03 15:28:23 +00:00
Skip Montanaro 9445ce57f1 note db2pickle.py and pickle2db.py 2003-02-03 15:09:32 +00:00
Skip Montanaro d96832914a dump database files to pickle format 2003-02-03 15:09:03 +00:00
Skip Montanaro 9db49c849c convert pickles generated by db2pickle.py back to database files 2003-02-03 15:08:42 +00:00
Skip Montanaro c064a1d7e3 add missing "summary" from long options list 2003-02-03 06:34:22 +00:00
Walter Dörwald 771bc377f8 Fix comment typo. 2003-02-02 23:39:45 +00:00
Guido van Rossum 8b7b345328 Use regular expressions for branch matching, to avoid including
changes on a sub-branch into output for a given branch.
2003-01-07 16:46:24 +00:00
Guido van Rossum bf1b1fdb9e Add byext.py 2003-01-02 02:24:22 +00:00
Guido van Rossum 6a8f7b741c Silly little script to print statistics (files, lines, words) by
extension.  Could use some work, but already very useful.
2003-01-01 14:41:25 +00:00
Jeremy Hylton 6bf45c6752 Correct buggy module docstring.
Replace use of homebrew boolean with True/False.

Reflow lots more long lines.
2002-12-11 21:43:13 +00:00
Jeremy Hylton 89f1d6c04e Fix one bug and reformat lots of code.
The bug is a reference to co_first_lineno that should be
co_firstlineno.  The only other substantial change is to speed up
localtrace_count() by avoiding *costly* calls to inspect module.
It's trivial to get the filename and lineno directly from the frame.

Otherwise, delete commented out debug code and reflow very long lines.
2002-12-11 21:28:32 +00:00
Skip Montanaro 7bc2e1dad7 add logmerge.py (pydoc is already installed) 2002-12-05 21:12:34 +00:00
Skip Montanaro da760c488f simple setup.py to install some interesting scripts in $(prefix)/bin. 2002-12-05 02:58:36 +00:00
Skip Montanaro a5f8c42268 * when given, port should be converted to int
* when connecting, if the port is non-standard, display it as well
2002-12-05 02:43:14 +00:00
Skip Montanaro 7dfb02d09a allow optional port specified as part of the hostname, e.g.,
"www.zope.org:8021".
2002-12-05 02:37:23 +00:00
Martin v. Löwis dab3bc05f3 Expand negative hexadecimal constants. 2002-11-23 12:08:10 +00:00
Martin v. Löwis 6f00a7ad84 Patch #542562, file 25252: Remove changelog. 2002-11-22 09:10:33 +00:00
Guido van Rossum affa6b7bf1 Tim wins a bet. Don't use re. 2002-11-13 21:04:31 +00:00
Guido van Rossum bc01c3248d Added -b tag option to limit output to a specific branch only.
Use -b HEAD to limit output to the trunk (skip all branch revisions).
2002-09-29 04:37:36 +00:00
Walter Dörwald aaab30e00c Apply diff2.txt from SF patch http://www.python.org/sf/572113
(with one small bugfix in bgen/bgen/scantools.py)

This replaces string module functions with string methods
for the stuff in the Tools directory. Several uses of
string.letters etc. are still remaining.
2002-09-11 20:36:02 +00:00
Michael W. Hudson dd32a91cc0 This is my patch
[ 587993 ] SET_LINENO killer

Remove SET_LINENO.  Tracing is now supported by inspecting co_lnotab.

Many sundry changes to document and adapt to this change.
2002-08-15 14:59:02 +00:00
Guido van Rossum 7ec34b556c A tool to transform gprof(1) output into HTML, so you can click on a
function name and go to the corresponding entry.
2002-08-09 20:07:34 +00:00
Skip Montanaro 3a48ed9481 * runctx - fix a couple typos
* globaltrace_lt - handle case where inspect.getmodulename doesn't return
  anything useful
* localtrace_trace - handle case where inspect.getframeinfo doesn't return
  any context info

I think both of the last two are caused by exec'd or eval'd code
2002-07-25 16:09:35 +00:00
Fred Drake ae39ddd628 Mechanically translated string method calls to string methods.
Instead of splitting a string and looping over it to call s.split(),
use list comprehensions for readability.
2002-06-18 15:37:05 +00:00
Fred Drake ef5864ed71 SF patch #552837, submitted by Robert Pyron:
1. BUGFIX: In function makefile(), strip blanks from the nodename.
   This is necesary to match the behavior of parser.makeref() and
   parser.do_node().
2. BUGFIX fixed KeyError in end_ifset (well, I may have just made
   it go away, rather than fix it)
3. BUGFIX allow @menu and menu items inside @ifset or @ifclear
4. Support added for:
      @uref        URL reference
      @image       image file reference (see note below)
      @multitable  output an HTML table
      @vtable
5. Partial support for accents, to match MAKEINFO output
6. I added a new command-line option, '-H basename', to specify
   HTML Help output. This will cause three files to be created
   in the current directory:
      `basename`.hhp  HTML Help Workshop project file
      `basename`.hhc  Contents file for the project
      `basename`.hhk  Index file for the project
   When fed into HTML Help Workshop, the resulting file will be
   named `basename`.chm.
7. A new class, HTMLHelp, to accomplish item 6.
8. Various calls to HTMLHelp functions.
A NOTE ON IMAGES: Just as 'outputdirectory' must exist before
running this program, all referenced images must already exist
in outputdirectory.

FLD: wrapped some long lines.
2002-06-18 15:21:21 +00:00
Martin v. Löwis f90ae20354 Patch #488073: AtheOS port. 2002-06-11 06:22:31 +00:00
Skip Montanaro 8c5763f3ea moving into the Doc/tools directory 2002-04-30 16:23:42 +00:00
Andrew M. Kuchling a90a3b471d Use md5.new() constructor 2002-04-17 21:53:21 +00:00
Andrew M. Kuchling 343cbd0279 Use 2.1's .hexdigest() method 2002-04-17 21:50:03 +00:00
Skip Montanaro 557fe7541d new script - helps track down symbols exported by modules but not
mentioned in the library reference manual
2002-03-28 22:01:40 +00:00
Skip Montanaro 9a29e7aba3 operate as a filter when no files or directories appear on the command line 2002-03-26 11:39:26 +00:00
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