editing .asp in PythonWin

Neil Hodgson nhodgson at bigpond.net.au
Sun Oct 21 18:38:54 EDT 2001


   Hi Doug,

> has anybody used pythonwin as an editor for writing active server
> pages? When opening a .asp it seems to do a good job on the
> html, but the python is all gray. is there a trick to getting the
> python part to show up as the colorful as well as the html, or in
> exchange for the html?

   The most recent version I have used, build 2.1.212 detects ASP files and
partly sets up for them, but does not assign colours to the styles
appropriately. Instead it applies the Python styles to HTML based on style
numbers which are really distinct between the two modes. ASP uses well over
a hundred styles but Python only 14. Because of this number of styles, ASP
mode needs 7 bits of styling as against Python mode using 5 bits which is
the default. This allows Python mode to use 3 bits for other purposes and it
does use at least one for indentation error indication.

   When showing ASP, SCISetStyleBits(7) should be called on the control.
Then there is a need to set up the styles which may be as simple as
producing an equivalent to the PYTHON_STYLES table in
pywin\scintilla\formatter.py for all the ASP styles and choosing to use that
instead of PYTHON_STYLES. The style constant names are those entries in
pywin\scintilla\scintillacon.py that start with SCE_H. It may require a bit
of effort following through the flow of control and I suspect its half a day
or so of work to implement this feature. From the evidence of the
source_formatter_extensions variable, it looks tome like someone, probably
Mark, has put some time into this but hasn't finished it.

   Neil








More information about the Python-list mailing list