[Idle-dev] FW: [Pythoncard-users] codeEditor sample

Kevin Altis altis@semi-retired.com
Mon, 6 May 2002 14:19:40 -0700


Hi,
this is just an FYI that PythonCard http://pythoncard.sourceforge.net/ now
has its own editor, based on the wxStyledTextCtrl (wxSTC) in wxPython. We
will be leveraging IDLE and Pythonwin code where appropriate, but since the
focus is on a wxPython code base rather than tkinter, I'm not sure how much
source will make sense to flow back into IDLE. Most of the heavy lifting is
actually done by wxSTC, so a lot of the basic editor logic required for IDLE
is not used at all. Of course, any bug fixes that impact IDLE will be
reported.

I'm subscribed to idle-dev, but will be traveling the latter part of May so
I probably won't be paying much attention the list until June. There should
be some more improvements to codeEditor this week in cvs as well as a new
PythonCard release before the end of the week and that release will include
codeEditor.

The announcement I made to the PythonCard-users list is below. The
codeEditor wiki page is at:

http://wiki.wxpython.org/index.cgi/PythonCardEditor

ka
---
Kevin Altis
altis@semi-retired.com

-----Original Message-----
From: pythoncard-users-admin@lists.sourceforge.net
[mailto:pythoncard-users-admin@lists.sourceforge.net]On Behalf Of Kevin
Altis
Sent: Monday, May 06, 2002 12:46 PM
To: pythoncard-Users
Subject: [Pythoncard-users] codeEditor sample


Ladies and gentlemen, I present the codeEditor sample.

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pythoncard/PythonCardPrototyp
e/samples/codeEditor/

Much like the resourceEditor sample, this will become a core element of
PythonCard and in the meantime is a workable sample.

This is not intended to be a full-featured generic editor. If you are
already using vi(m), Emacs, Boa, IDLE, or one of the many editors listed at
http://www.python.org/editors/ then there is no particular reason you need
to switch to codeEditor unless you want to.

What codeEditor will do is provide a free and integrated editor in
PythonCard designed to edit Python source code at least as well as IDLE and
Pythonwin. There will be a tight integration with the shell and
resourceEditor, features such as code completion, tooltips, module browsing,
running and debugging Python scripts should eventually be supported so this
isn't going to be a toy editor. I'm guessing that we'll end up with a merge
of resourceEditor and codeEditor eventually to give us an integrated
development environment (IDE).

The code is based on the textEditor sample. Last Friday after an email
exchange I decided I would rather see how difficult it would be to jump
start this rather than writing my umpteenth Mac OS X test script for the
week. I copied the textEditor sample, created a new CodeEditor component
that wraps the wxStyledTextCtrl (wxSTC) and fifteen minutes later the first
version was working. Patrick rolled some of the PyCrust code into the
component. With some more input from Patrick and Neil and some tweaking the
editor is already pretty usable, though many features are still missing.

I'm already starting to use it myself for all my Python editing. This is
known in the trade as "eating your own dog food" and it is a principle I
agree with because developers should suffer the same code as their users.

codeEditor already supports the Scriptlets addition I made to the textEditor
sample. That means you can extend codeEditor functionality and manipulate
the contents of the codeEditor window by writing and using Python
Scriptlets. Pretty cool. If you have a script idea or code (if you can do it
in the shell it can be a scriptlet) you would like added to the standard
distribution, just post it to the list. A lot of features will probably get
written and tested as scriptlets before being rolled into the main
codeEditor module.

http://aspn.activestate.com/ASPN/Mail/Message/PythonCard/1181106

I already updated findfiles so that if you double-click on a Python script
(.py or .pyw) in the results list it will open the codeEditor sample instead
of the textEditor sample. Some of findfiles will probably get rolled into
codeEditor.

What I don't want to do is make codeEditor a bloated editor with too many
options and UI elements so that it no longer fulfills its core purpose of
editing Python scripts.  Your input, code contributions, etc. as it
progresses will be appreciated.

I created a codeEditor wiki page to keep track of issues:

http://wiki.wxpython.org/index.cgi/PythonCardEditor

Note that if you are going to use codeEditor for your own scripts you should
be aware that it currently only supports tab stops of four spaces as Guido
recommends. It does not interpret or convert tabs. All of the PythonCard
source uses spaces. More elaborate tab support will be added. As always with
something like this, make backups of important files in case a bug in
codeEditor corrupts a source file.

wxSTC does not work correctly on OS X yet, so it won't run on OS X just like
the shell doesn't work on OS X, yet.

ka
_______________________________________________
Pythoncard-users mailing list
Pythoncard-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pythoncard-users