a6be3870b3
[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. |
||
---|---|---|
.. | ||
audiopy | ||
bgen | ||
faqwiz | ||
freeze | ||
idle | ||
modulator | ||
pynche | ||
scripts | ||
versioncheck | ||
webchecker | ||
world | ||
README |
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.