subset of Win32 ShellExecute's functionality. Guido wants this because
IDLE's Help -> Docs function currently crashes his machine because of a
conflict between his version of Norton AntiVirus (6.10.20) and MS's
_popen. Docs for startfile are being mailed to Fred (or just read the
docstring -- it tells the whole story).
Changed webbrowser.py to use os.startfile instead of os.popen on Windows.
Changed IDLE's EditorWindow.py to pass an absolute path for the docs
(hardcoding ShellExecute's "directory" arg to "." as used to be done let
IDLE work, but made the startfile command exceedingly obscure for other
uses -- the MS docs are terrible, of course, & still not sure I
understand it).
Note that Windows Python must link with shell32.lib now! That's where
ShellExecute lives.
Instead of using Netscape through os.system(), use the new
browser.open() function to load the documentation on the
default browser. On Windows, this will use the installed
documentation if it exists, instead of hitting python.org.
idle.py:
Load the config files before anything else happens
XXX Need to define standard way to get files relative to the
IDLE install dir
PyShell.py:
ColorDelegator.py:
Get color defns out of IdleConf instead of IdlePrefs
EditorWindow.py:
Replace hard-coded font & window size with config options
Get extension names via IdleConf.getextensions
extend.py:
Obsolete. Extensions defined in config file.
ParenMatch.py:
Use config file for extension options.
Revise comment about parser requirements.
Simplify logic on find returning None.
(Suggested by Moshe Zadka, but implemented differently.)
Add <<python-docs>> event which, on Unix, brings up Netscape pointing
to http://www.python.doc/current/ (a local copy would be nice but its
location can't be predicted). Windows solution TBD.
user what they want first if there's unsaved stuff, and may cancel).
It closes more than before.
Add unload_extensions() method to unload all extensions; called from
_close(). It calls an extension's close() method if it has one.
EditorWindow.py:
+ Added get_tabwidth & set_tabwidth "virtual text" methods, that get/set the
widget's view of what a tab means.
+ Moved TK_TABWIDTH_DEFAULT here from AutoIndent.
+ Renamed Mark's get_selection_index to get_selection_indices (sorry, Mark,
but the name was plain wrong <wink>).
FormatParagraph.py: renamed use of get_selection_index.
AutoIndent.py:
+ Moved TK_TABWIDTH_DEFAULT to EditorWindow.
+ Rewrote set_indentation_params to use new VTW get/set_tabwidth methods.
+ Changed smart_backspace_event to delete whitespace back to closest
preceding virtual tab stop or real character (note that this may require
inserting characters if backspacing over a tab!).
+ Nuked almost references to the selection tag, in favor of using
get_selection_indices. The sole exception is in set_region, for which no
"set_selection" abstraction has yet been agreed upon.
+ Had too much fun using the spiffy new features of the format-paragraph
cmd.
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.
2. No longer need to reset pyclbr cache and show watch cursor when calling
ClassBrowser -- the ClassBrowser takes care of pyclbr and the TreeWidget
takes care of the watch cursor.
3. Reset the focus to the current window after error message about class
browser on buffer without filename.
I'm still unsure, but couldn't stand the virtual event trickery so tried a
different sin (adding undo_block_start/stop methods to the Text instance in
EditorWindow.py). Like it or not, it's efficient and works <wink>. Better
idea?
Give the attached a whirl. Even if you hate the implementation, I think
you'll like the results. Think I caught all the "block edit" cmds,
including Format Paragraph, plus subtler ones involving smart indents and
backspacing.
with changed APIs -- it makes much more sense there.
Also add a new feature: if the first character of a menu label is
a '!', it gets a checkbox. Checkboxes are bound to Boolean Tcl variables
that can be accessed through the new getvar/setvar/getrawvar API;
the variable is named after the event to which the menu is bound.
Much has changed -- too much, in fact, to write down.
The big news is that there's a standard way to write IDLE extensions;
see extend.txt. Some sample extensions have been provided, and
some existing code has been converted to extensions. Probably the
biggest new user feature is a new search dialog with more options,
search and replace, and even search in files (grep).
This is exactly as downloaded from my laptop after returning
from the holidays -- it hasn't even been tested on Unix yet.