cpython/Tools
Guido van Rossum a6be3870b3 Tim Peters again:
[Tim, after adding some bracket smarts to AutoIndent.py]
> ...
> What it can't possibly do without reparsing large gobs of text is
> suggest a reasonable indent level after you've *closed* a bracket
> left open on some previous line.
> ...

The attached can, and actually fast enough to use -- most of the time.  The
code is tricky beyond belief to achieve that, but it works so far; e.g.,

        return len(string.expandtabs(str[self.stmt_start :
                                         ^ indents to caret
                                         i],
                                     ^ indents to caret
                                     self.tabwidth)) + 1
    ^ indents to caret

It's about as smart as pymode now, wrt both bracket and backslash
continuation rules.  It does require reparsing large gobs of text, and if it
happens to find something that looks like a "def" or "class" or sys.ps1
buried in a multiline string, but didn't suck up enough preceding text to
see the start of the string, it's completely hosed.  I can't repair that --
it's just too slow to reparse from the start of the file all the time.

AutoIndent has grown a new num_context_lines tuple attribute that controls
how far to look back, and-- like other params --this could/should be made
user-overridable at startup and per-file on the fly.
1999-06-01 19:52:34 +00:00
..
audiopy updates for latest release 1999-05-01 16:27:23 +00:00
bgen New mixin class that defines cmp and hash that use 1999-03-15 16:37:54 +00:00
faqwiz Provide more detail when the commit button is not shown. 1998-12-23 21:33:09 +00:00
freeze Bug submitted by Wayne Knowles, who writes: 1999-03-12 22:07:05 +00:00
idle Tim Peters again: 1999-06-01 19:52:34 +00:00
modulator Comment out confusing write call. 1999-02-18 14:22:05 +00:00
pynche Use the much nicer tkFileDialog for loading color name database files 1999-04-27 19:51:55 +00:00
scripts Use re instead of regex. 1999-04-09 14:56:35 +00:00
versioncheck Reindented without tabs and with uniform 4 space indent. 1998-04-06 14:20:27 +00:00
webchecker Some changes (maybe not enough?) to make it work on Windows with local 1999-04-26 23:11:46 +00:00
world Eugene Dvurechenski <jno@glas.net> says: 1999-05-26 04:02:18 +00:00
README Change the example of what's in scripts/. 1998-04-10 20:58:53 +00:00

README

This directory contains a number of Python programs that are useful
while building or extending Python.

bgen		Generate complete extension modules from a
		description.  Still under development!

faqwiz		FAQ Wizard.
		See http://grail.cnri.reston.va.us/cgi-bin/faqw.py
		for a live example.

freeze		Create a stand-alone executable from a Python program.

modulator	Interactively generate boiler plate for an extension
		module.  Works easiest if you have Tk.

scripts		A number of useful single-file programs, e.g. tabnanny.py
		(by Tim Peters), which checks for inconsistent mixing
		of tabs and spaces.

versioncheck	A tool to automate checking whether you have the latest
		version of a package (by Jack Jansen).

webchecker	A link checker for web sites.