this functionality is not present (e.g. when used with a vintage
Python 1.5.2 installation) top-level functions are not listed.
(Hmm... Any distribution of IDLE 0.5 should probably include a copy
of the new pyclbr.py!)
Hammond: record top-level functions (as Function instances, a simple
subclass of Class). You must use the new interface readmodule_ex() to
get these, though.
__init__.py it isn't read. (Sjoerd just came up with this, so it's
not heavily tested.)
Other (yet unsolved) package problems noted by Sjoerd:
- If you have a package and a module inside that or another package
with the same name, module caching doesn't work properly since the
key is the base name of the module/package.
- The only entry that is returned when you readmodule a package is a
__path__ whose value is a list which confuses certain class browsers
that I wrote. (Hm, this could be construed as a feature.)
I've updated cPickle.c to use class exceptions:
Changed pickle error types to classes:
PickleError
PicklingError
UnpickleableError
UnpicklingError
And change the handling of unpickleable objects so that an UnpickleableError
is raised with the unpickleable object as the argument. UnpickleableError
has a reasonable string representation and provides access to the problem
object, which is useful during debugging.
[I'm still waiting for patches to do the same to pickle.py.]
indicate to those that are using the CVS access that they are using a
newer-than-1.2.5 version, without committing to a particular version
number or patch level.
I've found two places where smtplib.py sends an extra trailing space
on command lines to the SMTP server. I don't know if this ever causes
any problems, but I'd prefer to be on the safe side. The enclosed
patch removes the extra space.
all processing instruction target names containing 'xml' were
rejected, instead (as the standard rejects) only the name 'xml' itself
(or case variants thereof).
I guess in 1.5.2 a new module, whichdb, was added that attempts to
divine the nature of a database file. This module doesn't know anything
about Berkeley DB v2 files. In v2, Sleepycat added a 12-byte null pad
in front of the old magic numbers (at least for hash and btree files).
I've been using v2 for awhile and upgrading to 1.5.2 broke all my
anydbm.open calls. I believe the following patch corrects the problem.
+ Set usetabs=1. Editing pyclbr.py was driving me nuts <0.6 wink>.
usetabs=1 is the Emacs pymode default too, and thanks to indentwidth !=
tabwidth magical usetabs disabling, new files are still created with tabs
turned off. The only implication is that if you open a file whose first
indent is a single tab, IDLE will now magically use tabs for that file (and
set indentwidth to 8). Note that the whole scheme doesn't work right for
PythonWin, though, since Windows users typically set tabwidth to 4; Mark
probably has to hide the IDLE algorithm from them (which he already knows).
+ Changed comment_region_event to stick "##" in front of every line. The
"holes" previously left on blank lines were visually confusing (made it
needlessly hard to figure out what to uncomment later).
appreciably. Triple-quoted strings no longer confuse it, nor nested
classes or defs, nor comments starting in column 1. Chews thru
Tkinter.py in < 3 seconds for me; doctest.py no longer confuses it; no
longer missing methods in PyShell.py; etc. Also captures defs
starting in column 1 now, but ignores them; an interface should be
added so that IDLE's class browser can show the top-level functions
too.
'install_site_lib' and install_site_platlib' on non-POSIX platforms.
Should at least work for NT, as this is adopted from Amos Latteier's NT
patches. Also added extensive comments bitching about the inadequacy of
the current model, both under POSIX and NT (and probably other) systems.
'run_command()' to refer to it before attempting to run a command --
that way, command classes can freely invoke other commands without fear
of duplicate execution.
Beefed up some comments and docstrings.
It wasn't hard to speed pyclbr by a factor of 3, and I'll attach an
experimental patch for that (experimental because barely tested). Uncomment
the new "String" stuff and it will deal with strings correctly (pyclbr
currently ignores the possibility), but that slows it down a lot. Still
faster in the end than current pyclbr, but-- frankly --I'd rather have the
dramatic speedup!
specifier came from an int expression instead of a constant in the
format, a negative width was truncated to zero instead of taken to
mean the same as that negative constant plugged into the format. E.g.
"(%*s)" % (-5, "foo") yielded "(foo)" while "(%-5s)" yields "(foo )".
Now both yield the latter -- like sprintf() in C.
Smarter logic for finding a parse synch point.
Does a half to a fifth the work in normal cases; don't notice the speedup,
but makes more breathing room for other extensions.
Speeds terrible cases by at least a factor of 10. "Terrible" == e.g. you put
""" at the start of Tkinter.py, undo it, zoom to the bottom, and start
typing in code. Used to take about 8 seconds for ENTER to respond, now some
large fraction of a second. The new code gets indented correctly, despite
that it all remains "string colored" until the colorizer catches up (after
which, ENTER appears instantaneous again).
IDLE is now the first Python editor in the Universe not confused by my
doctest.py <wink>.
As threatened, this defines IDLE's is_char_in_string function as a
method of EditorWindow. You just need to define one similarly in
whatever it is you pass as editwin to AutoIndent; looking at the
EditorWindow.py part of the patch should make this clear.